Trait former::ToSuperFormer

source ·
pub trait ToSuperFormer<T, Context> {
    // Required method
    fn call(&self, container: T, context: Option<Context>) -> Context;
}
Expand description

Defines a handler for the end of a subforming process, enabling the return of the original context.

This trait is designed to be flexible, allowing for various end-of-forming behaviors in builder patterns. Implementors can define how to transform or pass through the context during the forming process’s completion.

§Parameters

  • T: The type of the container being processed.
  • Context: The type of the context that might be altered or returned upon completion.

Required Methods§

source

fn call(&self, container: T, context: Option<Context>) -> Context

Called at the end of the subforming process to return the modified or original context.

§Parameters
  • container: The container being processed.
  • context: Optional context to be transformed or returned.
§Returns

Returns the transformed or original context based on the implementation.

Implementors§

source§

impl<T> ToSuperFormer<T, T> for ReturnContainer

source§

impl<T, Context> ToSuperFormer<T, Context> for NoEnd

source§

impl<T, Context, F> ToSuperFormer<T, Context> for F
where F: Fn(T, Option<Context>) -> Context,