pub struct Object { /* private fields */ }
Expand description
A wrapper for Cell that provides type-specific operations with the Cell data.
You can construct this object using Cell::into_object.
To discover which operations are available for this Object, you can explore its Prototype using the Object::prototype function.
Implementations§
Source§impl Object
impl Object
Sourcepub fn assign(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<()>
pub fn assign(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<()>
Calls an assignment operator (lhs = rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn component(
self,
origin: Origin,
lhs: Origin,
rhs: Ident,
) -> RuntimeResult<Cell>
pub fn component( self, origin: Origin, lhs: Origin, rhs: Ident, ) -> RuntimeResult<Cell>
Returns a Cell that points to a component of the object
(e.g., an object’s method or a predefined field), such as foo.bar
.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the name of the component/field. You
can obtain the component’s identifier using, for example, the
FieldSymbol::ident
function.
The function returns a RuntimeError if the Object’s type does not have this component or if the component fetching implementation returns a RuntimeError.
Sourcepub fn component_or_field(
self,
origin: Origin,
lhs: Origin,
rhs: Ident,
) -> RuntimeResult<Cell>
pub fn component_or_field( self, origin: Origin, lhs: Origin, rhs: Ident, ) -> RuntimeResult<Cell>
Similar to Object::component, but if the Object’s type does not have a component with the specified name, it falls back to Object::field.
Sourcepub fn field(
self,
origin: Origin,
lhs: Origin,
rhs: Ident,
) -> RuntimeResult<Cell>
pub fn field( self, origin: Origin, lhs: Origin, rhs: Ident, ) -> RuntimeResult<Cell>
Returns a Cell that points to a field resolved at runtime, such as
foo.bar
.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the name of the field. You can obtain
the field’s identifier using, for example, the
FieldSymbol::ident
function.
The function returns a RuntimeError if the Object’s type does not implement a runtime field resolver or if the resolver’s implementation returns a RuntimeError.
Sourcepub fn clone(self, origin: Origin, rhs: Origin) -> RuntimeResult<Cell>
pub fn clone(self, origin: Origin, rhs: Origin) -> RuntimeResult<Cell>
Calls a Clone operator (*foo
) on this Object, creating a clone of
the underlying Cell’s data.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The rhs
parameter specifies the Rust or Script source code range
that spans the operand (this Object).
The function returns a RuntimeError if the Object’s type does not support the “clone” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn debug(
self,
origin: Origin,
lhs: Origin,
formatter: &mut Formatter<'_>,
) -> RuntimeResult<()>
pub fn debug( self, origin: Origin, lhs: Origin, formatter: &mut Formatter<'_>, ) -> RuntimeResult<()>
Calls a Debug operator on this Object to format the underlying Cell’s data for debugging purposes.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the operand (this Object).
The formatter
parameter specifies the Rust Formatter that will be
passed to the Debug::fmt function.
The function returns a RuntimeError if the Object’s type does not support the “debug” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn display(
self,
origin: Origin,
lhs: Origin,
formatter: &mut Formatter<'_>,
) -> RuntimeResult<()>
pub fn display( self, origin: Origin, lhs: Origin, formatter: &mut Formatter<'_>, ) -> RuntimeResult<()>
Calls a Display operator on this Object to format the underlying Cell’s data for display purposes.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the operand (this Object).
The formatter
parameter specifies the Rust Formatter that will be
passed to the Display::fmt function.
The function returns a RuntimeError if the Object’s type does not support the “display” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn partial_eq(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<bool>
pub fn partial_eq( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<bool>
Calls an equality operator (lhs == rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the equality operator or if the operator’s implementation returns a RuntimeError.
Note that in the current model of script interpretation, partial equality (PartialEq) also serves the purpose of full equality (Eq).
Sourcepub fn partial_ord(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<Option<Ordering>>
pub fn partial_ord( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<Option<Ordering>>
Calls a partial ordering operator (lhs >= rhs
, lhs < rhs
, etc.) on
this Object as the left-hand side (LHS) of the operation.
Returns the result of the objects’ comparison via PartialOrd.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the partial ordering operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn ord(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<Ordering>
pub fn ord( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<Ordering>
Calls a full ordering operator (lhs >= rhs
, lhs < rhs
, etc.) on
this Object as the left-hand side (LHS) of the operation.
Returns the result of the objects’ comparison via Ord.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the full ordering operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn ord_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<Ordering>
pub fn ord_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<Ordering>
Similar to Object::ord, but if the Object’s type does not support the full ordering operator, it falls back to Object::partial_ord. If the partial ordering returns None, this function returns a RuntimeError indicating that the “ord” operator is not supported.
Sourcepub fn hash(
self,
origin: Origin,
lhs: Origin,
hasher: &mut impl Hasher,
) -> RuntimeResult<()>
pub fn hash( self, origin: Origin, lhs: Origin, hasher: &mut impl Hasher, ) -> RuntimeResult<()>
Feeds this Object’s content into the specified hasher
.
The origin
parameter specifies the Rust or Script source code range
that spans the hashing operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the hashing operand (this Object).
The function returns a RuntimeError if the Object’s type does not support the “hash” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn invoke(
self,
origin: Origin,
lhs: Origin,
arguments: &mut [Arg],
) -> RuntimeResult<Cell>
pub fn invoke( self, origin: Origin, lhs: Origin, arguments: &mut [Arg], ) -> RuntimeResult<Cell>
Calls an invocation operator (func(arg1, arg2, arg3)
) on this Object
as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “invoke” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bind(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<()>
pub fn bind(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<()>
Sets the invocation context of the object.
The meaning of the binding operator is type-dependent, but usually it sets the context in which this object will be invoked.
For example, in the foo.bar()
code, the interpreter would first bind
“bar” to “foo,” assuming “foo” is the
receiver-parameter of the “bar” function.
Then, the interpreter would call the invocation operator on the bound
“bar” Object.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the binding context
(the source code range and the data of the context Cell).
The function returns a RuntimeError if the Object’s type does not support the “binding” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn add(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn add(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls an addition operator (lhs + rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “add” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn add_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn add_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls an addition-assignment operator (lhs += rhs
) on this Object as
the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “add-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn add_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn add_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::add_assign, but if the Object’s type does not support the “add-assign” operator, it falls back to Object::add, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “add-assign” operator is not supported.
Sourcepub fn sub(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn sub(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a subtraction operator (lhs - rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “sub” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn sub_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn sub_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a subtraction-assignment operator (lhs -= rhs
) on this Object
as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “sub-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn sub_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn sub_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::sub_assign, but if the Object’s type does not support the “sub-assign” operator, it falls back to Object::sub, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “sub-assign” operator is not supported.
Sourcepub fn mul(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn mul(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a multiplication operator (lhs * rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “mul” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn mul_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn mul_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a multiplication-assignment operator (lhs *= rhs
) on this
Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “mul-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn mul_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn mul_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::mul_assign, but if the Object’s type does not support the “mul-assign” operator, it falls back to Object::mul, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “mul-assign” operator is not supported.
Sourcepub fn div(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn div(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a division operator (lhs / rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “div” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn div_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn div_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a division-assignment operator (lhs /= rhs
) on this
Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “div-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn div_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn div_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::div_assign, but if the Object’s type does not support the “div-assign” operator, it falls back to Object::div, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “div-assign” operator is not supported.
Sourcepub fn and(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn and(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a logical conjunction operator (lhs && rhs
) on this Object as
the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “and” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn or(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn or(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a logical disjunction operator (lhs || rhs
) on this Object as
the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “or” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn not(self, origin: Origin, rhs: Origin) -> RuntimeResult<Cell>
pub fn not(self, origin: Origin, rhs: Origin) -> RuntimeResult<Cell>
Calls a logical negation operator (!rhs
) on this Object.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The rhs
parameter specifies the Rust or Script source code range
that spans the operand (this Object).
The function returns a RuntimeError if the Object’s type does not support the “not” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn neg(self, origin: Origin, rhs: Origin) -> RuntimeResult<Cell>
pub fn neg(self, origin: Origin, rhs: Origin) -> RuntimeResult<Cell>
Calls a numeric negation operator (-rhs
) on this Object.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The rhs
parameter specifies the Rust or Script source code range
that spans the operand (this Object).
The function returns a RuntimeError if the Object’s type does not support the “neg” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_and(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<Cell>
pub fn bit_and( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<Cell>
Calls a bitwise conjunction operator (lhs & rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “bit-and” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_and_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn bit_and_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a bitwise conjunction and assignment operator (lhs &= rhs
) on
this Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “bit-and-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_and_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn bit_and_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::bit_and_assign, but if the Object’s type does not support the “bit-and-assign” operator, it falls back to Object::bit_and, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “bit-and-assign” operator is not supported.
Sourcepub fn bit_or(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<Cell>
pub fn bit_or( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<Cell>
Calls a bitwise disjunction operator (lhs | rhs
) on this Object as the
left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “bit-or” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_or_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn bit_or_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a bitwise disjunction and assignment operator (lhs |= rhs
) on
this Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “bit-or-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_or_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn bit_or_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::bit_or_assign, but if the Object’s type does not support the “bit-or-assign” operator, it falls back to Object::bit_or, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “bit-or-assign” operator is not supported.
Sourcepub fn bit_xor(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<Cell>
pub fn bit_xor( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<Cell>
Calls a bitwise exclusive disjunction operator (lhs ^ rhs
) on this
Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “bit-xor” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_xor_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn bit_xor_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a bitwise exclusive disjunction and assignment operator
(lhs ^= rhs
) on this Object as the left-hand side (LHS) of the
operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “bit-xor-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn bit_xor_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn bit_xor_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::bit_xor_assign, but if the Object’s type does not support the “bit-xor-assign” operator, it falls back to Object::bit_xor, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “bit-xor-assign” operator is not supported.
Sourcepub fn shl(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn shl(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a bitwise left shift operator (lhs << rhs
) on this
Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “shl” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn shl_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn shl_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a bitwise left shift and assignment operator (lhs <<= rhs
) on
this Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “shl-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn shl_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn shl_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::shl_assign, but if the Object’s type does not support the “shl-assign” operator, it falls back to Object::shl, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “shl-assign” operator is not supported.
Sourcepub fn shr(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn shr(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a bitwise right shift operator (lhs >> rhs
) on this
Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “shr” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn shr_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn shr_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a bitwise right shift and assignment operator (lhs >>= rhs
) on
this Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the
operation, including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “shr-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn shr_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn shr_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Same as Object::shr_assign, but if the Object’s type does not support an “shr-assign” operator, falls back to the Object::shr, and then to the Object::assign.
If the falling-back operators are not supported as well, this function returns RuntimeError indicating that the “shr-assign” operator is not supported.
Sourcepub fn rem(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
pub fn rem(self, origin: Origin, lhs: Origin, rhs: Arg) -> RuntimeResult<Cell>
Calls a remainder of division operator (lhs % rhs
) on this Object as
the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “rem” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn rem_assign(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn rem_assign( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Calls a remainder of division and assignment operator (lhs %= rhs
) on
this Object as the left-hand side (LHS) of the operation.
The origin
parameter specifies the Rust or Script source code range
that spans the operator.
The lhs
parameter specifies the Rust or Script source code range
that spans the left-hand operand (this Object).
The rhs
parameter specifies the right-hand side (RHS) of the operation,
including the source code range and the data of the RHS.
The function returns a RuntimeError if the Object’s type does not support the “rem-assign” operator or if the operator’s implementation returns a RuntimeError.
Sourcepub fn rem_assign_fallback(
self,
origin: Origin,
lhs: Origin,
rhs: Arg,
) -> RuntimeResult<()>
pub fn rem_assign_fallback( self, origin: Origin, lhs: Origin, rhs: Arg, ) -> RuntimeResult<()>
Similar to Object::rem_assign, but if the Object’s type does not support the “rem-assign” operator, it falls back to Object::rem, and then to Object::assign.
If the fallback operators are also not supported, this function returns a RuntimeError indicating that the “rem-assign” operator is not supported.
Sourcepub fn ty(&self) -> &'static TypeMeta
pub fn ty(&self) -> &'static TypeMeta
Returns the metadata of the Object’s type (similar to Cell::ty).
Sourcepub fn prototype(&self) -> &'static Prototype
pub fn prototype(&self) -> &'static Prototype
Returns a Prototype of the Object’s type, which describes the operations available for this type.
Sourcepub fn into_cell(self) -> Cell
pub fn into_cell(self) -> Cell
Converts this object back into the underlying Cell.
This operation is the reverse of Cell::into_object.