pub enum Mutability {
Pure(pure),
View(view),
Constant(constant),
Payable(payable),
}
Expand description
A mutability attribute.
Variants§
Implementations§
Source§impl Mutability
impl Mutability
Sourcepub fn new_constant(span: Span) -> Self
pub fn new_constant(span: Span) -> Self
Creates a new Constant
keyword with the given span
.
Sourcepub fn new_payable(span: Span) -> Self
pub fn new_payable(span: Span) -> Self
Creates a new Payable
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_constant(self) -> bool
pub const fn is_constant(self) -> bool
Returns true if self
matches Self::Constant
.
Sourcepub const fn is_payable(self) -> bool
pub const fn is_payable(self) -> bool
Returns true if self
matches Self::Payable
.
Trait Implementations§
Source§impl Clone for Mutability
impl Clone for Mutability
Source§fn clone(&self) -> Mutability
fn clone(&self) -> Mutability
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 Mutability
impl Debug for Mutability
Source§impl Display for Mutability
impl Display for Mutability
Source§impl Hash for Mutability
impl Hash for Mutability
Source§impl Parse for Mutability
impl Parse for Mutability
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for Mutability
impl PartialEq for Mutability
Source§impl Spanned for Mutability
impl Spanned for Mutability
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 Mutability
impl Eq for Mutability
Auto Trait Implementations§
impl Freeze for Mutability
impl RefUnwindSafe for Mutability
impl !Send for Mutability
impl !Sync for Mutability
impl Unpin for Mutability
impl UnwindSafe for Mutability
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