pub struct Struct { /* private fields */ }Expand description
A struct declaration.
Trait Implementations§
Source§impl Ord for Struct
impl Ord for Struct
Source§impl PartialOrd for Struct
impl PartialOrd for Struct
Source§impl Statement for Struct
impl Statement for Struct
Source§fn write(&self, b: &mut CodeBuffer, level: usize)
fn write(&self, b: &mut CodeBuffer, level: usize)
Writes the code to the buffer
b at the indent level.Source§impl WithAccess for Struct
impl WithAccess for Struct
Source§fn set_access<A>(&mut self, access: A)
fn set_access<A>(&mut self, access: A)
Sets the
access level.Source§fn with_access<A>(self, access: A) -> Self
fn with_access<A>(self, access: A) -> Self
Sets the
access level.Source§fn write_access(&self, b: &mut CodeBuffer)
fn write_access(&self, b: &mut CodeBuffer)
Writes the access level.
Source§impl WithComments for Struct
impl WithComments for Struct
Source§fn add_comment<S>(&mut self, comment: S)
fn add_comment<S>(&mut self, comment: S)
Adds the
comment line.Source§fn with_comment<S>(self, comment: S) -> Self
fn with_comment<S>(self, comment: S) -> Self
Adds the
comment line.Source§fn write_comments(
&self,
comment_type: CommentType,
b: &mut CodeBuffer,
level: usize,
)
fn write_comments( &self, comment_type: CommentType, b: &mut CodeBuffer, level: usize, )
Writes the comment lines.
Source§impl WithDerives for Struct
impl WithDerives for Struct
Source§fn add_derive<S>(&mut self, derive: S)
fn add_derive<S>(&mut self, derive: S)
Adds the derivation.
Source§fn with_derive<S>(self, derive: S) -> Self
fn with_derive<S>(self, derive: S) -> Self
Adds the derivation.
Source§fn write_derives(&self, b: &mut CodeBuffer, level: usize)
fn write_derives(&self, b: &mut CodeBuffer, level: usize)
Writes the derive tag.
Source§impl WithGenerics for Struct
impl WithGenerics for Struct
Source§fn add_generic<V>(&mut self, generic: V)
fn add_generic<V>(&mut self, generic: V)
Adds the
generic type parameter.Source§fn with_generic<V>(self, generic: V) -> Self
fn with_generic<V>(self, generic: V) -> Self
Adds the
generic type parameter.Source§fn write_generic_brackets(&self, b: &mut CodeBuffer)
fn write_generic_brackets(&self, b: &mut CodeBuffer)
Writes the generic brackets. (ex:
<A: TypeA, B: TypeB>)Source§impl WithName for Struct
impl WithName for Struct
Source§fn write_name(&self, b: &mut CodeBuffer)
fn write_name(&self, b: &mut CodeBuffer)
Writes the name.
Source§impl WithStructFields for Struct
impl WithStructFields for Struct
Source§fn fields(&self) -> &[StructField]
fn fields(&self) -> &[StructField]
Gets the struct fields.
Source§fn add_field<F>(&mut self, field: F)where
F: Into<StructField>,
fn add_field<F>(&mut self, field: F)where
F: Into<StructField>,
Adds the struct
field.Source§fn with_field<F>(self, field: F) -> Selfwhere
F: Into<StructField>,
fn with_field<F>(self, field: F) -> Selfwhere
F: Into<StructField>,
Adds the struct
field.Source§fn write_fields(&self, b: &mut CodeBuffer, level: usize)
fn write_fields(&self, b: &mut CodeBuffer, level: usize)
Writes the struct fields.
impl Eq for Struct
impl StructuralPartialEq for Struct
Auto Trait Implementations§
impl Freeze for Struct
impl RefUnwindSafe for Struct
impl Send for Struct
impl Sync for Struct
impl Unpin for Struct
impl UnwindSafe for Struct
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