Skip to main content

Layer

Struct Layer 

Source
pub struct Layer<'a, M> { /* private fields */ }
Expand description

A component shown over a Layers host’s base: a modal dialog or a popover. It closes when it answers (its flow still goes up, so a mapped Flow::Done finishes the host), when it cancels or Escape reaches the host unused (it is dismissed, the host carries on), or through a LayerHandle.

Implementations§

Source§

impl<'a, M> Layer<'a, M>

Source

pub fn modal(child: impl Component<Output = M> + 'a) -> Layer<'a, M>

A modal layer: see LayerKind::Modal.

Source

pub fn popover(child: impl Component<Output = M> + 'a) -> Layer<'a, M>

A popover: see LayerKind::Popover.

Source

pub fn size(self, width: usize, height: usize) -> Self

Centred, width × height cells with the border (default 40 × 10).

Source

pub fn placement(self, placement: Placement) -> Self

Source

pub fn title(self, title: impl Into<String>) -> Self

A title in the top border.

Source

pub fn border(self, on: bool) -> Self

Draw a border round it (default: yes).

Source

pub fn backdrop(self, on: bool) -> Self

Dim what is under it (default: for a modal).

Source

pub fn dismissable(self, on: bool) -> Self

Whether Escape, reaching the host unused, closes it (default: yes).

Source

pub fn kind(&self) -> LayerKind

Auto Trait Implementations§

§

impl<'a, M> !RefUnwindSafe for Layer<'a, M>

§

impl<'a, M> !Send for Layer<'a, M>

§

impl<'a, M> !Sync for Layer<'a, M>

§

impl<'a, M> !UnwindSafe for Layer<'a, M>

§

impl<'a, M> Freeze for Layer<'a, M>
where Box<dyn Component<Output = M> + 'a>: Freeze,

§

impl<'a, M> Unpin for Layer<'a, M>
where Box<dyn Component<Output = M> + 'a>: Unpin,

§

impl<'a, M> UnsafeUnpin for Layer<'a, M>
where Box<dyn Component<Output = M> + 'a>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.