composed_partial_getter

Function composed_partial_getter 

Source
pub fn composed_partial_getter<S, A, I, E, PG1: PartialGetter<S, I>, PG2: PartialGetter<I, A>>(
    pg1: PG1,
    pg2: PG2,
    error_fn_1: fn(PG1::GetterError) -> E,
    error_fn_2: fn(PG2::GetterError) -> E,
) -> PartialGetterImpl<S, A, impl PartialGetter<S, A, GetterError = E>>
Expand description

Creates a PartialGetter<S,A> combined from two optics <S, I>, <I, A> applied one after another.

This struct is automatically created by composing two existing optics, and is not intended to be directly constructed outside the crate. Instead, it is generated through composition of two optics via the corresponding composable_with_XXX methods, where the two optics can be of any valid optic type that results in a PartialGetter.

§Type Parameters

  • S: The source type of the first optic
  • A: The target type of the second optic
  • I: The intermediate type: the target type of the first optic and the source type of the second optic
  • E: The common error type for both optics

§Arguments

  • pg1: The first optic of type PartialGetter<S, I>
  • pg2: The second optic of type PartialGetter<I, A>
  • error_fn_1: A function that maps the error type of the first optic to a common error type E
  • error_fn_2: A function that maps the error type of the second optic to a common error type E

This struct should not be manually constructed by users. Instead, it is created via composition of two optics using the appropriate compose_with_XXX methods on each optic impl. The ComposedPartialGetter structure is provided internally by the crate after you compose valid optics.

§See Also

  • PartialGetter — the optic type that ComposedPartialGetter is based on