Struct subxt_codegen::Derives
source · pub struct Derives { /* private fields */ }Expand description
A struct storing the set of derives and derive attributes that we’ll apply to generated types.
Implementations§
source§impl Derives
impl Derives
sourcepub fn with_defaults(crate_path: &CratePath) -> Self
pub fn with_defaults(crate_path: &CratePath) -> Self
Creates a new instance of Derives with the crate_path prepended
to the set of default derives that reside in subxt.
sourcepub fn extend_from(&mut self, other: Derives)
pub fn extend_from(&mut self, other: Derives)
Extend this set of Derives from another.
sourcepub fn insert_codec_compact_as(&mut self, crate_path: &CratePath)
pub fn insert_codec_compact_as(&mut self, crate_path: &CratePath)
Add #crate_path::ext::codec::CompactAs to the derives.
sourcepub fn extend(&mut self, derives: impl Iterator<Item = Path>)
pub fn extend(&mut self, derives: impl Iterator<Item = Path>)
Extend the set of derives by providing an iterator of paths to derive macros.
sourcepub fn insert_derive(&mut self, derive: Path)
pub fn insert_derive(&mut self, derive: Path)
Insert a single derive.
sourcepub fn insert_attribute(&mut self, attribute: Attribute)
pub fn insert_attribute(&mut self, attribute: Attribute)
Insert a single attribute to be applied to types.
Trait Implementations§
source§impl FromIterator<Path> for Derives
impl FromIterator<Path> for Derives
source§impl ToTokens for Derives
impl ToTokens for Derives
source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere Self: Sized,
Auto Trait Implementations§
impl RefUnwindSafe for Derives
impl !Send for Derives
impl !Sync for Derives
impl Unpin for Derives
impl UnwindSafe for Derives
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere T: Spanned + ?Sized,
source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.