pub enum UnOp {
Increment(Plus, Plus),
Decrement(Minus, Minus),
Not(Not),
BitNot(Tilde),
Neg(Minus),
}
Expand description
Unary operators.
Variants§
Implementations§
Source§impl UnOp
impl UnOp
Sourcepub fn new_increment(span: Span) -> Self
pub fn new_increment(span: Span) -> Self
Creates a new Increment
operator with the given span
.
Sourcepub fn new_decrement(span: Span) -> Self
pub fn new_decrement(span: Span) -> Self
Creates a new Decrement
operator with the given span
.
Sourcepub fn new_bit_not(span: Span) -> Self
pub fn new_bit_not(span: Span) -> Self
Creates a new BitNot
operator with the given span
.
pub fn peek(input: ParseStream<'_>, lookahead: &Lookahead1<'_>) -> bool
pub const fn as_str(self) -> &'static str
pub const fn as_debug_str(self) -> &'static str
Sourcepub const fn is_increment(self) -> bool
pub const fn is_increment(self) -> bool
Returns true if self
matches Self::Increment
.
Sourcepub const fn is_decrement(self) -> bool
pub const fn is_decrement(self) -> bool
Returns true if self
matches Self::Decrement
.
Sourcepub const fn is_bit_not(self) -> bool
pub const fn is_bit_not(self) -> bool
Returns true if self
matches Self::BitNot
.
Trait Implementations§
Source§impl Spanned for UnOp
impl Spanned for UnOp
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 UnOp
impl Eq for UnOp
Auto Trait Implementations§
impl Freeze for UnOp
impl RefUnwindSafe for UnOp
impl !Send for UnOp
impl !Sync for UnOp
impl Unpin for UnOp
impl UnwindSafe for UnOp
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