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§
Sourcefn and_then<O, F>(self, function: F) -> TemplateFunction<Self, F>
fn and_then<O, F>(self, function: F) -> TemplateFunction<Self, F>
Translates to a property that will apply fallible function to an
extracted value.
Sourcefn map<O, F>(self, function: F) -> impl TemplateProperty<Output = O>
fn map<O, F>(self, function: F) -> impl TemplateProperty<Output = O>
Translates to a property that will apply function to an extracted
value, leaving Err untouched.
Sourcefn try_unwrap<O>(self, type_name: &str) -> impl TemplateProperty<Output = O>
fn try_unwrap<O>(self, type_name: &str) -> impl TemplateProperty<Output = O>
Translates to a property that will unwrap an extracted Option value
of the specified type_name, mapping None to Err.
Sourcefn into_serialize<'a>(self) -> BoxedSerializeProperty<'a>
fn into_serialize<'a>(self) -> BoxedSerializeProperty<'a>
Converts this property into boxed serialize property.
Sourcefn into_template<'a>(self) -> Box<dyn Template + 'a>
fn into_template<'a>(self) -> Box<dyn Template + 'a>
Converts this property into Template.
Sourcefn into_dyn<'a>(self) -> BoxedTemplateProperty<'a, Self::Output>where
Self: Sized + 'a,
fn into_dyn<'a>(self) -> BoxedTemplateProperty<'a, Self::Output>where
Self: Sized + 'a,
Converts this property into boxed trait object.
Sourcefn into_dyn_wrapped<'a, W>(self) -> W
fn into_dyn_wrapped<'a, W>(self) -> W
Converts this property into wrapped (or tagged) type.
Use W::wrap_property() if the self type is known to be boxed.