Skip to main content

Part

Struct Part 

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

What a widget puts in another widget’s bay. The host lays it out in the owner’s popover or dialog, and sends what it does back to the widget that made it.

Implementations§

Source§

impl<M> Part<M>

Source

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

Source

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

Sent each time the popover or dialog it’s in opens, if the part shows then.

Source

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

Sent each time the popover or dialog it’s in starts closing.

Source

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

Trait Implementations§

Source§

impl<M> From<Panel<M>> for Part<M>

A popover as a part, for a widget that can sit on its own or in another’s bay: its content and its open and close messages. Being wide doesn’t carry over: the owner’s popover sets the width.

Source§

fn from(panel: Panel<M>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for Part<M>

§

impl<M> !Send for Part<M>

§

impl<M> !Sync for Part<M>

§

impl<M> !UnwindSafe for Part<M>

§

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

§

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

§

impl<M> UnsafeUnpin for Part<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.