Trait ScriptField

Source
pub trait ScriptField {
    type Result: ?Sized;

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

A dynamic resolver of the object fields: foo.bar.

Implementing this trait enables the Object::field 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.

If the type is fully dynamic, consider using the DynamicType type as a Result specification.

Required Methods§

Source

fn script_field(origin: Origin, lhs: Arg, rhs: Ident) -> RuntimeResult<Cell>

Operation implementation.

The parameters and return type of this function correspond to those of the Object::field 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.

Implementors§