pub enum FunctionKind {
Constructor(constructor),
Function(function),
Fallback(fallback),
Receive(receive),
Modifier(modifier),
}
Expand description
The kind of function.
Variants§
Constructor(constructor)
constructor
Function(function)
function
Fallback(fallback)
fallback
Receive(receive)
receive
Modifier(modifier)
modifier
Implementations§
Source§impl FunctionKind
impl FunctionKind
Sourcepub fn new_constructor(span: Span) -> Self
pub fn new_constructor(span: Span) -> Self
Creates a new Constructor
keyword with the given span
.
Sourcepub fn new_function(span: Span) -> Self
pub fn new_function(span: Span) -> Self
Creates a new Function
keyword with the given span
.
Sourcepub fn new_fallback(span: Span) -> Self
pub fn new_fallback(span: Span) -> Self
Creates a new Fallback
keyword with the given span
.
Sourcepub fn new_receive(span: Span) -> Self
pub fn new_receive(span: Span) -> Self
Creates a new Receive
keyword with the given span
.
Sourcepub fn new_modifier(span: Span) -> Self
pub fn new_modifier(span: Span) -> Self
Creates a new Modifier
keyword with the given span
.
pub fn parse_opt(input: ParseStream<'_>) -> Result<Option<Self>>
pub fn peek(lookahead: &Lookahead1<'_>) -> bool
pub const fn as_str(self) -> &'static str
pub const fn as_debug_str(self) -> &'static str
Sourcepub const fn is_constructor(self) -> bool
pub const fn is_constructor(self) -> bool
Returns true if self
matches Self::Constructor
.
Sourcepub const fn is_function(self) -> bool
pub const fn is_function(self) -> bool
Returns true if self
matches Self::Function
.
Sourcepub const fn is_fallback(self) -> bool
pub const fn is_fallback(self) -> bool
Returns true if self
matches Self::Fallback
.
Sourcepub const fn is_receive(self) -> bool
pub const fn is_receive(self) -> bool
Returns true if self
matches Self::Receive
.
Sourcepub const fn is_modifier(self) -> bool
pub const fn is_modifier(self) -> bool
Returns true if self
matches Self::Modifier
.
Trait Implementations§
Source§impl Clone for FunctionKind
impl Clone for FunctionKind
Source§fn clone(&self) -> FunctionKind
fn clone(&self) -> FunctionKind
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FunctionKind
impl Debug for FunctionKind
Source§impl Display for FunctionKind
impl Display for FunctionKind
Source§impl Hash for FunctionKind
impl Hash for FunctionKind
Source§impl Parse for FunctionKind
impl Parse for FunctionKind
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for FunctionKind
impl PartialEq for FunctionKind
Source§impl Spanned for FunctionKind
impl Spanned for FunctionKind
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.impl Copy for FunctionKind
impl Eq for FunctionKind
Auto Trait Implementations§
impl Freeze for FunctionKind
impl RefUnwindSafe for FunctionKind
impl !Send for FunctionKind
impl !Sync for FunctionKind
impl Unpin for FunctionKind
impl UnwindSafe for FunctionKind
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