pub struct StructBuilder { /* private fields */ }Expand description
Helper to build a struct with attributes.
Implementations§
Source§impl StructBuilder
impl StructBuilder
pub fn new(name: &str) -> Self
pub fn add_attr(&mut self, attr: &str) -> &mut Self
pub fn add_derive(&mut self, derive: &str) -> &mut Self
pub fn add_field( &mut self, name: &str, ty: &str, attrs: Vec<String>, ) -> &mut Self
pub fn add_field_with_doc( &mut self, name: &str, ty: &str, attrs: Vec<String>, doc: &str, ) -> &mut Self
pub fn build(&self) -> String
Auto Trait Implementations§
impl Freeze for StructBuilder
impl RefUnwindSafe for StructBuilder
impl Send for StructBuilder
impl Sync for StructBuilder
impl Unpin for StructBuilder
impl UnsafeUnpin for StructBuilder
impl UnwindSafe for StructBuilder
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