pub struct StructDecl {
pub name: Ident,
pub type_params: Vec<TypeParam>,
pub fields: Vec<FieldDecl>,
pub vis: Visibility,
}Expand description
Struct declaration: struct Point { x: f64, y: f64 }
Structs are product types with named fields. By default, fields are mutable unless the binding is immutable.
Fields§
§name: IdentName of the struct.
type_params: Vec<TypeParam>Generic type parameters (e.g., <T>).
fields: Vec<FieldDecl>Named fields with types and optional defaults.
vis: VisibilityVisibility qualifier (pub or private).
Trait Implementations§
Source§impl Clone for StructDecl
impl Clone for StructDecl
Source§fn clone(&self) -> StructDecl
fn clone(&self) -> StructDecl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StructDecl
impl RefUnwindSafe for StructDecl
impl Send for StructDecl
impl Sync for StructDecl
impl Unpin for StructDecl
impl UnsafeUnpin for StructDecl
impl UnwindSafe for StructDecl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more