Struct odra_ir::module::Constructor
source · pub struct Constructor {
pub attrs: Vec<OdraAttribute>,
pub impl_item: ImplItemMethod,
pub ident: Ident,
pub args: Punctuated<PatType, Comma>,
pub full_sig: Signature,
}Expand description
Odra constructor definition.
§Examples
#[odra(init)]
#[other_attribute]
pub fn set_initial_value(&self, value: u32) {
// initialization logic goes here
}Fields§
§attrs: Vec<OdraAttribute>§impl_item: ImplItemMethod§ident: Ident§args: Punctuated<PatType, Comma>§full_sig: SignatureTrait Implementations§
source§impl ToTokens for Constructor
impl ToTokens for Constructor
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,
source§impl TryFrom<ImplItemMethod> for Constructor
impl TryFrom<ImplItemMethod> for Constructor
Auto Trait Implementations§
impl Freeze for Constructor
impl RefUnwindSafe for Constructor
impl !Send for Constructor
impl !Sync for Constructor
impl Unpin for Constructor
impl UnwindSafe for Constructor
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§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.