pub struct Event { /* private fields */ }
Expand description
A checked ink! event with its configuration.
Implementations§
Source§impl Event
impl Event
Sourcepub fn new(config: TokenStream2, item: TokenStream2) -> Result<Self, Error>
pub fn new(config: TokenStream2, item: TokenStream2) -> Result<Self, Error>
Returns Ok
if the input matches all requirements for an ink! event.
Sourcepub fn item(&self) -> &ItemStruct
pub fn item(&self) -> &ItemStruct
Returns the event definition .
Sourcepub fn anonymous(&self) -> bool
pub fn anonymous(&self) -> bool
Returns if the event is marked as anonymous, if true then no signature topic is generated or emitted.
Sourcepub fn signature_topic_hex(&self) -> Option<&str>
pub fn signature_topic_hex(&self) -> Option<&str>
Sourcepub fn get_cfg_attrs(&self, span: Span) -> Vec<TokenStream2>
pub fn get_cfg_attrs(&self, span: Span) -> Vec<TokenStream2>
Returns a list of cfg
attributes if any.
Trait Implementations§
Source§impl ToTokens for Event
impl ToTokens for Event
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
We mainly implement this trait for this ink! type to have a derived
Spanned
implementation for it.
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<ItemStruct> for Event
impl TryFrom<ItemStruct> for Event
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl !Send for Event
impl !Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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.