Trait MethodType

Source
pub trait MethodType<D: DataType>: Sized + Default {
    type Method: ?Sized;
    type GetProp: ?Sized;
    type SetProp: ?Sized;

    // Required methods
    fn call_getprop(
        _: &Self::GetProp,
        _: &mut IterAppend<'_>,
        _: &PropInfo<'_, Self, D>,
    ) -> Result<(), MethodErr>;
    fn call_setprop(
        _: &Self::SetProp,
        _: &mut Iter<'_>,
        _: &PropInfo<'_, Self, D>,
    ) -> Result<(), MethodErr>;
    fn call_method(
        _: &Self::Method,
        _: &MethodInfo<'_, Self, D>,
    ) -> MethodResult;
    fn make_getprop<H>(h: H) -> Box<Self::GetProp>
       where H: Fn(&mut IterAppend<'_>, &PropInfo<'_, Self, D>) -> Result<(), MethodErr> + Send + Sync + 'static;
    fn make_method<H>(h: H) -> Box<Self::Method>
       where H: Fn(&MethodInfo<'_, Self, D>) -> MethodResult + Send + Sync + 'static;
}
Expand description

A helper trait used internally to make the tree generic over MTFn, MTFnMut and MTSync.

You should not need to call these methods directly, it’s primarily for internal use.

Required Associated Types§

Source

type Method: ?Sized

For internal use.

Source

type GetProp: ?Sized

For internal use.

Source

type SetProp: ?Sized

For internal use.

Required Methods§

Source

fn call_getprop( _: &Self::GetProp, _: &mut IterAppend<'_>, _: &PropInfo<'_, Self, D>, ) -> Result<(), MethodErr>

For internal use.

Source

fn call_setprop( _: &Self::SetProp, _: &mut Iter<'_>, _: &PropInfo<'_, Self, D>, ) -> Result<(), MethodErr>

For internal use.

Source

fn call_method(_: &Self::Method, _: &MethodInfo<'_, Self, D>) -> MethodResult

For internal use.

Source

fn make_getprop<H>(h: H) -> Box<Self::GetProp>
where H: Fn(&mut IterAppend<'_>, &PropInfo<'_, Self, D>) -> Result<(), MethodErr> + Send + Sync + 'static,

For internal use.

Source

fn make_method<H>(h: H) -> Box<Self::Method>
where H: Fn(&MethodInfo<'_, Self, D>) -> MethodResult + Send + Sync + 'static,

For internal use.

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§

Source§

impl<D: DataType> MethodType<D> for MTFn<D>

Source§

type GetProp = dyn Fn(&mut IterAppend<'_>, &PropInfo<'_, MTFn<D>, D>) -> Result<(), MethodErr>

Source§

type SetProp = dyn Fn(&mut Iter<'_>, &PropInfo<'_, MTFn<D>, D>) -> Result<(), MethodErr>

Source§

type Method = dyn Fn(&MethodInfo<'_, MTFn<D>, D>) -> Result<Vec<Message>, MethodErr>

Source§

impl<D: DataType> MethodType<D> for MTFnMut<D>

Source§

type GetProp = RefCell<dyn FnMut(&mut IterAppend<'_>, &PropInfo<'_, MTFnMut<D>, D>) -> Result<(), MethodErr>>

Source§

type SetProp = RefCell<dyn FnMut(&mut Iter<'_>, &PropInfo<'_, MTFnMut<D>, D>) -> Result<(), MethodErr>>

Source§

type Method = RefCell<dyn FnMut(&MethodInfo<'_, MTFnMut<D>, D>) -> Result<Vec<Message>, MethodErr>>

Source§

impl<D: DataType> MethodType<D> for MTSync<D>

Source§

type GetProp = dyn Fn(&mut IterAppend<'_>, &PropInfo<'_, MTSync<D>, D>) -> Result<(), MethodErr> + Send + Sync

Source§

type SetProp = dyn Fn(&mut Iter<'_>, &PropInfo<'_, MTSync<D>, D>) -> Result<(), MethodErr> + Send + Sync

Source§

type Method = dyn Fn(&MethodInfo<'_, MTSync<D>, D>) -> Result<Vec<Message>, MethodErr> + Send + Sync