Trait ScriptNeg

Source
pub trait ScriptNeg {
    type Result: ?Sized;

    // Required method
    fn script_neg(origin: Origin, lhs: Arg) -> RuntimeResult<Cell>;
}
Expand description

A script numeric negation operator: -foo.

Implementing this trait enables the Object::neg operation.

The trait must be implemented for the registered type, and the implementation must be exported using the export macro. For more details, see the module documentation.

Required Associated Types§

Source

type Result: ?Sized

A rough estimation of the result type of this operation.

This type must implement ScriptType.

Required Methods§

Source

fn script_neg(origin: Origin, lhs: Arg) -> RuntimeResult<Cell>

Operation implementation.

The parameters and return type of this function correspond to those of the Object::neg function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ScriptNeg for i8

Source§

impl ScriptNeg for i16

Source§

impl ScriptNeg for i32

Source§

impl ScriptNeg for i64

Source§

impl ScriptNeg for i128

Source§

impl ScriptNeg for isize

Source§

impl ScriptNeg for u8

Source§

impl ScriptNeg for u16

Source§

impl ScriptNeg for u32

Source§

impl ScriptNeg for u64

Source§

impl ScriptNeg for u128

Source§

impl ScriptNeg for usize

Implementors§