Trait ScriptPartialOrd

Source
pub trait ScriptPartialOrd {
    type RHS: ?Sized;

    // Required method
    fn script_partial_cmp(
        origin: Origin,
        lhs: Arg,
        rhs: Arg,
    ) -> RuntimeResult<Option<Ordering>>;
}
Expand description

A script partial ordering operator: lhs >= rhs, lhs < rhs, etc.

Implementing this trait enables the Object::partial_ord 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 RHS: ?Sized

A rough estimation of the type of the right-hand side of the operation.

This type must implement ScriptType.

Required Methods§

Source

fn script_partial_cmp( origin: Origin, lhs: Arg, rhs: Arg, ) -> RuntimeResult<Option<Ordering>>

Operation implementation.

The parameters and return type of this function correspond to those of the Object::partial_ord 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 ScriptPartialOrd for bool

Source§

impl ScriptPartialOrd for f32

Source§

impl ScriptPartialOrd for f64

Source§

impl ScriptPartialOrd for i8

Source§

impl ScriptPartialOrd for i16

Source§

impl ScriptPartialOrd for i32

Source§

impl ScriptPartialOrd for i64

Source§

impl ScriptPartialOrd for i128

Source§

impl ScriptPartialOrd for isize

Source§

impl ScriptPartialOrd for u8

Source§

impl ScriptPartialOrd for u16

Source§

impl ScriptPartialOrd for u32

Source§

impl ScriptPartialOrd for u64

Source§

impl ScriptPartialOrd for u128

Source§

impl ScriptPartialOrd for usize

Implementors§