Trait xylem::Xylem[][src]

pub trait Xylem<S: Schema + ?Sized>: Sized + 'static {
    type From: Sized;
    type Args: Default;
    fn convert_impl(
        from: Self::From,
        context: &mut <S as Schema>::Context,
        args: &Self::Args
    ) -> Result<Self, <S as Schema>::Error>; fn convert(
        from: Self::From,
        context: &mut <S as Schema>::Context,
        args: &Self::Args
    ) -> Result<Self, <S as Schema>::Error> { ... } }
Expand description

Implementors of this trait have a special conversion rule under the schema Schema.

Associated Types

The type to convert from.

The args provided in the field.

The type must be a struct that implements Default, allowing the macro to instantiate it in the following format:

Args {
   key1: value1,
   key2: value2,
   ..Default::default()
}

where the macro has the field attribute #[xylem(key1 = value1, key2 = value2)].

Required methods

The implementation of the conversion.

Provided methods

Converts the From type to the Self type, registering the scope with the context. Do not override this method.

Implementations on Foreign Types

The unit type is used as the dummy type for the root scope.

Implementors