Skip to main content

ComponentExt

Trait ComponentExt 

Source
pub trait ComponentExt: Component + Sized {
    // Provided methods
    fn map<'a, M>(
        self,
        done: impl FnMut(Self::Output) -> Flow<M> + 'a,
    ) -> Map<'a, Self, M>
       where Self: 'a { ... }
    fn with_overlays<'a>(self) -> Overlays<'a, Self::Output>
       where Self: 'a,
             Self::Output: 'a { ... }
    fn boxed<'a>(self) -> Child<'a, Self::Output>
       where Self: 'a { ... }
}
Expand description

Adapters for putting any component in a container.

Provided Methods§

Source

fn map<'a, M>( self, done: impl FnMut(Self::Output) -> Flow<M> + 'a, ) -> Map<'a, Self, M>
where Self: 'a,

Turn this component’s answer into M’s flow: Flow::Done(m) to finish the whole composition with m, Flow::Continue to carry on (the component stays, showing its answer, and focus moves past it). Cancelling cancels the composition unless on_cancel says otherwise.

Source

fn with_overlays<'a>(self) -> Overlays<'a, Self::Output>
where Self: 'a, Self::Output: 'a,

Wrap this component in Overlays: a command palette, help and a shortcut sheet read from its keymap, and room for a status bar and breadcrumbs.

Source

fn boxed<'a>(self) -> Child<'a, Self::Output>
where Self: 'a,

Box this component as a Child.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§