Struct rhai::OpAssignment
source · [−]pub struct OpAssignment {
pub hash_op_assign: u64,
pub hash_op: u64,
pub op_assign: &'static str,
pub op: &'static 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: &'static str
Op-assignment operator.
op: &'static 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 Clone for OpAssignment
impl Clone for OpAssignment
sourcefn clone(&self) -> OpAssignment
fn clone(&self) -> OpAssignment
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 Hash for OpAssignment
impl Hash for OpAssignment
sourceimpl PartialEq<OpAssignment> for OpAssignment
impl PartialEq<OpAssignment> for OpAssignment
sourcefn eq(&self, other: &OpAssignment) -> bool
fn eq(&self, other: &OpAssignment) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl Copy for OpAssignment
impl Eq for OpAssignment
impl StructuralEq for OpAssignment
impl StructuralPartialEq for OpAssignment
Auto Trait Implementations
impl RefUnwindSafe for OpAssignment
impl Send for OpAssignment
impl Sync for OpAssignment
impl Unpin for OpAssignment
impl UnwindSafe for OpAssignment
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