TemplatePropertyExt

Trait TemplatePropertyExt 

Source
pub trait TemplatePropertyExt: TemplateProperty {
    // Provided methods
    fn and_then<O, F>(self, function: F) -> TemplateFunction<Self, F>
       where Self: Sized,
             F: Fn(Self::Output) -> Result<O, TemplatePropertyError> { ... }
    fn map<O, F>(self, function: F) -> impl TemplateProperty<Output = O>
       where Self: Sized,
             F: Fn(Self::Output) -> O { ... }
    fn try_unwrap<O>(self, type_name: &str) -> impl TemplateProperty<Output = O>
       where Self: TemplateProperty<Output = Option<O>> + Sized { ... }
    fn into_serialize<'a>(self) -> BoxedSerializeProperty<'a>
       where Self: Sized + 'a,
             Self::Output: Serialize { ... }
    fn into_template<'a>(self) -> Box<dyn Template + 'a>
       where Self: Sized + 'a,
             Self::Output: Template { ... }
    fn into_dyn<'a>(self) -> BoxedTemplateProperty<'a, Self::Output>
       where Self: Sized + 'a { ... }
    fn into_dyn_wrapped<'a, W>(self) -> W
       where Self: Sized + 'a,
             W: WrapTemplateProperty<'a, Self::Output> { ... }
}
Expand description

TemplateProperty adapters that are useful when implementing methods.

Provided Methods§

Source

fn and_then<O, F>(self, function: F) -> TemplateFunction<Self, F>
where Self: Sized, F: Fn(Self::Output) -> Result<O, TemplatePropertyError>,

Translates to a property that will apply fallible function to an extracted value.

Source

fn map<O, F>(self, function: F) -> impl TemplateProperty<Output = O>
where Self: Sized, F: Fn(Self::Output) -> O,

Translates to a property that will apply function to an extracted value, leaving Err untouched.

Source

fn try_unwrap<O>(self, type_name: &str) -> impl TemplateProperty<Output = O>
where Self: TemplateProperty<Output = Option<O>> + Sized,

Translates to a property that will unwrap an extracted Option value of the specified type_name, mapping None to Err.

Source

fn into_serialize<'a>(self) -> BoxedSerializeProperty<'a>
where Self: Sized + 'a, Self::Output: Serialize,

Converts this property into boxed serialize property.

Source

fn into_template<'a>(self) -> Box<dyn Template + 'a>
where Self: Sized + 'a, Self::Output: Template,

Converts this property into Template.

Source

fn into_dyn<'a>(self) -> BoxedTemplateProperty<'a, Self::Output>
where Self: Sized + 'a,

Converts this property into boxed trait object.

Source

fn into_dyn_wrapped<'a, W>(self) -> W
where Self: Sized + 'a, W: WrapTemplateProperty<'a, Self::Output>,

Converts this property into wrapped (or tagged) type.

Use W::wrap_property() if the self type is known to be boxed.

Implementors§