pub struct ViewScope<In, Out, V: View<Out>, PrevChain, InnerSteps> { /* private fields */ }Expand description
Builder for steps inside a .view::<V>() scope.
V is the view marker (implements View<Out>). Steps resolve
against V::StaticViewType via IntoRefStep.
Implementations§
Source§impl<In, Out, V: View<Out>, PrevChain, InnerSteps> ViewScope<In, Out, V, PrevChain, InnerSteps>
impl<In, Out, V: View<Out>, PrevChain, InnerSteps> ViewScope<In, Out, V, PrevChain, InnerSteps>
Sourcepub fn tap<Params, S: IntoRefStep<V::StaticViewType, (), Params>>(
self,
f: S,
registry: &Registry,
) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewTap<S::Step>)>
pub fn tap<Params, S: IntoRefStep<V::StaticViewType, (), Params>>( self, f: S, registry: &Registry, ) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewTap<S::Step>)>
Observe the view. Side effects via Res/ResMut.
Step signature: fn(Params..., &ViewType) -> ().
Sourcepub fn inspect<S: IntoRefStep<V::StaticViewType, (), ()>>(
self,
f: S,
registry: &Registry,
) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewTap<S::Step>)>
pub fn inspect<S: IntoRefStep<V::StaticViewType, (), ()>>( self, f: S, registry: &Registry, ) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewTap<S::Step>)>
Observe the view without side effects (no Params).
Step signature: fn(&ViewType).
Sourcepub fn filter<Params, S: IntoRefStep<V::StaticViewType, bool, Params>>(
self,
f: S,
registry: &Registry,
) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewGuard<S::Step>)>
pub fn filter<Params, S: IntoRefStep<V::StaticViewType, bool, Params>>( self, f: S, registry: &Registry, ) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewGuard<S::Step>)>
Filter the event based on the view. Same as guard — returns
bool to accept/reject.
Step signature: fn(Params..., &ViewType) -> bool.
Sourcepub fn guard<Params, S: IntoRefStep<V::StaticViewType, bool, Params>>(
self,
f: S,
registry: &Registry,
) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewGuard<S::Step>)>
pub fn guard<Params, S: IntoRefStep<V::StaticViewType, bool, Params>>( self, f: S, registry: &Registry, ) -> ViewScope<In, Out, V, PrevChain, (InnerSteps, ViewGuard<S::Step>)>
Guard the event based on the view.
Step signature: fn(Params..., &ViewType) -> bool.
Source§impl<In, Out, V, PrevChain, InnerSteps> ViewScope<In, Out, V, PrevChain, InnerSteps>where
PrevChain: ChainCall<In, Out = Out>,
V: View<Out>,
InnerSteps: ViewSteps<V::StaticViewType>,
impl<In, Out, V, PrevChain, InnerSteps> ViewScope<In, Out, V, PrevChain, InnerSteps>where
PrevChain: ChainCall<In, Out = Out>,
V: View<Out>,
InnerSteps: ViewSteps<V::StaticViewType>,
Sourcepub fn end_view(
self,
) -> PipelineChain<In, Out, ViewNode<PrevChain, InnerSteps, V>>
pub fn end_view( self, ) -> PipelineChain<In, Out, ViewNode<PrevChain, InnerSteps, V>>
Close the view scope. The event passes through unchanged.
Sourcepub fn end_view_guarded(
self,
) -> PipelineChain<In, Option<Out>, ViewGuardedNode<PrevChain, InnerSteps, V>>
pub fn end_view_guarded( self, ) -> PipelineChain<In, Option<Out>, ViewGuardedNode<PrevChain, InnerSteps, V>>
Close the view scope. If any guard rejected, returns None.
Source§impl<In, Out, V, PrevChain, InnerSteps> ViewScope<In, Out, V, PrevChain, InnerSteps>where
PrevChain: ChainCall<In, Out = Out>,
V: View<Out>,
InnerSteps: ViewSteps<V::StaticViewType>,
Out: 'static,
impl<In, Out, V, PrevChain, InnerSteps> ViewScope<In, Out, V, PrevChain, InnerSteps>where
PrevChain: ChainCall<In, Out = Out>,
V: View<Out>,
InnerSteps: ViewSteps<V::StaticViewType>,
Out: 'static,
Sourcepub fn end_view_dag(
self,
) -> DagChain<In, Out, ViewNode<PrevChain, InnerSteps, V>>
pub fn end_view_dag( self, ) -> DagChain<In, Out, ViewNode<PrevChain, InnerSteps, V>>
Close the view scope, returning a DagChain.
Sourcepub fn end_view_dag_guarded(
self,
) -> DagChain<In, Option<Out>, ViewGuardedNode<PrevChain, InnerSteps, V>>
pub fn end_view_dag_guarded( self, ) -> DagChain<In, Option<Out>, ViewGuardedNode<PrevChain, InnerSteps, V>>
Close a guarded view scope, returning a DagChain.
Sourcepub fn end_view_arm(self) -> DagArm<In, Out, ViewNode<PrevChain, InnerSteps, V>>
pub fn end_view_arm(self) -> DagArm<In, Out, ViewNode<PrevChain, InnerSteps, V>>
Close the view scope, returning a DagArm.
Sourcepub fn end_view_arm_guarded(
self,
) -> DagArm<In, Option<Out>, ViewGuardedNode<PrevChain, InnerSteps, V>>
pub fn end_view_arm_guarded( self, ) -> DagArm<In, Option<Out>, ViewGuardedNode<PrevChain, InnerSteps, V>>
Close a guarded view scope, returning a DagArm.