composed_getter

Function composed_getter 

Source
pub fn composed_getter<S, A, I, G1: Getter<S, I>, G2: Getter<I, A>>(
    l1: G1,
    l2: G2,
) -> GetterImpl<S, A, impl Getter<S, A>>
Expand description

Creates a Getter<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 compose_with_XXX methods, where the two optics can be of any valid optic type that results in a Getter.

§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

§Arguments

  • g1: The first optic of type Getter<S, I>
  • g2: The second optic of type Getter<I, A>

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 ComposedGetter structure is provided internally by the crate after you compose valid optics.

§See Also

  • Getter — the optic type that ComposedGetter is based on