pub enum AssocOp {
Binary(BinOpKind),
AssignOp(BinOpKind),
Assign,
Cast,
Range(RangeLimits),
}
Expand description
Associative operator.
Variants§
Binary(BinOpKind)
A binary op.
AssignOp(BinOpKind)
?=
where ? is one of the assignable BinOps
Assign
=
Cast
as
Range(RangeLimits)
..
or ..=
range
Implementations§
Source§impl AssocOp
impl AssocOp
Sourcepub fn from_token(t: &Token) -> Option<AssocOp>
pub fn from_token(t: &Token) -> Option<AssocOp>
Creates a new AssocOp from a token.
Sourcepub fn precedence(&self) -> ExprPrecedence
pub fn precedence(&self) -> ExprPrecedence
Gets the precedence of this operator
pub fn is_comparison(&self) -> bool
pub fn is_assign_like(&self) -> bool
Sourcepub fn can_continue_expr_unambiguously(&self) -> bool
pub fn can_continue_expr_unambiguously(&self) -> bool
This operator could be used to follow a block unambiguously.
This is used for error recovery at the moment, providing a suggestion to wrap blocks with parentheses while having a high degree of confidence on the correctness of the suggestion.
Trait Implementations§
impl Copy for AssocOp
impl StructuralPartialEq for AssocOp
Auto Trait Implementations§
impl DynSend for AssocOp
impl DynSync for AssocOp
impl Freeze for AssocOp
impl RefUnwindSafe for AssocOp
impl Send for AssocOp
impl Sync for AssocOp
impl Unpin for AssocOp
impl UnwindSafe for AssocOp
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 2 bytes
Size for each variant:
Binary
: 1 byteAssignOp
: 1 byteAssign
: 0 bytesCast
: 0 bytesRange
: 1 byte