Struct rhai::OpAssignment
source · [−]pub struct OpAssignment<'a> {
pub hash_op_assign: u64,
pub hash_op: u64,
pub op_assign: &'a str,
pub op: &'a str,
pub pos: Position,
}
Expand description
(internals) An op-assignment operator.
Exported under the internals
feature only.
This type may hold a straight assignment (i.e. not an op-assignment).
Fields
hash_op_assign: u64
Hash of the op-assignment call.
hash_op: u64
Hash of the underlying operator call (for fallback).
op_assign: &'a str
Op-assignment operator.
op: &'a str
Underlying operator.
pos: Position
Position of the op-assignment operator.
Implementations
sourceimpl OpAssignment<'_>
impl OpAssignment<'_>
sourcepub const fn new_assignment(pos: Position) -> Self
pub const fn new_assignment(pos: Position) -> Self
Create a new OpAssignment
that is only a straight assignment.
sourcepub const fn is_op_assignment(&self) -> bool
pub const fn is_op_assignment(&self) -> bool
Is this an op-assignment?
sourcepub fn new_op_assignment(name: &str, pos: Position) -> Self
pub fn new_op_assignment(name: &str, pos: Position) -> Self
sourcepub fn new_op_assignment_from_token(op: Token, pos: Position) -> Self
pub fn new_op_assignment_from_token(op: Token, pos: Position) -> Self
Create a new OpAssignment
from a Token
.
Panics
Panics if the token is not an op-assignment operator.
sourcepub fn new_op_assignment_from_base(name: &str, pos: Position) -> Self
pub fn new_op_assignment_from_base(name: &str, pos: Position) -> Self
Create a new OpAssignment
from a base operator.
Panics
Panics if the name is not an operator that can be converted into an op-operator.
sourcepub fn new_op_assignment_from_base_token(op: Token, pos: Position) -> Self
pub fn new_op_assignment_from_base_token(op: Token, pos: Position) -> Self
Convert a Token
into a new OpAssignment
.
Panics
Panics if the token is cannot be converted into an op-assignment operator.
Trait Implementations
sourceimpl<'a> Clone for OpAssignment<'a>
impl<'a> Clone for OpAssignment<'a>
sourcefn clone(&self) -> OpAssignment<'a>
fn clone(&self) -> OpAssignment<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for OpAssignment<'_>
impl Debug for OpAssignment<'_>
sourceimpl<'a> Hash for OpAssignment<'a>
impl<'a> Hash for OpAssignment<'a>
sourceimpl<'a> PartialEq<OpAssignment<'a>> for OpAssignment<'a>
impl<'a> PartialEq<OpAssignment<'a>> for OpAssignment<'a>
sourcefn eq(&self, other: &OpAssignment<'a>) -> bool
fn eq(&self, other: &OpAssignment<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &OpAssignment<'a>) -> bool
fn ne(&self, other: &OpAssignment<'a>) -> bool
This method tests for !=
.
impl<'a> Copy for OpAssignment<'a>
impl<'a> Eq for OpAssignment<'a>
impl<'a> StructuralEq for OpAssignment<'a>
impl<'a> StructuralPartialEq for OpAssignment<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for OpAssignment<'a>
impl<'a> Send for OpAssignment<'a>
impl<'a> Sync for OpAssignment<'a>
impl<'a> Unpin for OpAssignment<'a>
impl<'a> UnwindSafe for OpAssignment<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more