Skip to main content

Panel

Struct Panel 

Source
pub struct Panel<M> { /* private fields */ }
Expand description

The contents of a popover. The host draws the surface, its background and its edges, and lays every popover out at the same width, or at a wider one if it asks (Panel::wide).

Implementations§

Source§

impl<M> Panel<M>

Source

pub fn new(content: Node<M>) -> Self

Source

pub fn wide(self) -> Self

Laid out wider than other popovers, for a page that’s mostly reading: a conversation, a document. The host decides how wide.

Source

pub fn on_open(self, message: M) -> Self

Sent each time the popover opens: start a scan, show the first page.

Source

pub fn on_close(self, message: M) -> Self

Sent each time the popover starts closing: stop listening, forget what was typed.

Source

pub fn map<N: 'static>( self, f: &(impl Fn(M) -> N + Clone + 'static), ) -> Panel<N>
where M: 'static,

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for Panel<M>

§

impl<M> !Send for Panel<M>

§

impl<M> !Sync for Panel<M>

§

impl<M> !UnwindSafe for Panel<M>

§

impl<M> Freeze for Panel<M>
where Node<M>: Freeze, Option<M>: Freeze,

§

impl<M> Unpin for Panel<M>
where Node<M>: Unpin, Option<M>: Unpin,

§

impl<M> UnsafeUnpin for Panel<M>

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.