Rust

#[derive] (Debug, Clone, PartialEq)

Në shqip përdoret i njëjti emër.

ShpjegimiSQ

#[derive(...)] i thotë kompajlerit të shkruajë vetë implementimin e disa trait-eve të zakonshme për struct-in tënd — Debug (për {:?}), Clone, PartialEq (për ==), Default, Hash.

EnglishEN

#[derive(...)] tells the compiler to write the implementation of some common traits for your struct — Debug (for {:?}), Clone, PartialEq (for ==), Default, Hash.

Si ta mendosh

Si formulari i gatshëm që plotësohet vetë me të dhënat standarde.

Lexoje në anglisht

Like a ready-made form that fills itself in with the standard details.

Shembull kodirust

#[derive(Debug, Clone, PartialEq, Default)]
struct Pika { x: i32, y: i32 }
println!("{:?}", Pika { x: 1, y: 2 });

Terma të lidhur