Wrapper

Struct Wrapper 

Source
pub struct Wrapper<Message, Content, L, R>
where Content: Widget<Message, LayoutInfo = L, RenderInfo = R>, L: LayoutInfo, R: RenderInfo,
{ /* private fields */ }
Expand description

Adds to a Widget padding and border.

Implementations§

Source§

impl<Message, Content, L, R> Wrapper<Message, Content, L, R>
where Content: Widget<Message, LayoutInfo = L, RenderInfo = R>, L: LayoutInfo, R: RenderInfo,

Source

pub fn new(content: Content) -> Self

Source

pub fn with_padding(self, padding: Margin) -> Self

Trait Implementations§

Source§

impl<Message, Content, L, R> Widget<Message> for Wrapper<Message, Content, L, R>
where Content: Widget<Message, LayoutInfo = L, RenderInfo = R>, L: LayoutInfo, R: RenderInfo,

Source§

type LayoutInfo = WrapperLayout<L>

Source§

type RenderInfo = R

Source§

fn render( &self, position: Position, layout: &Self::LayoutInfo, context: &mut dyn RenderContext, ) -> Result<Self::RenderInfo>

Renders itself to the given context based on the state.
Source§

fn layout(&self, available_size: Size) -> Self::LayoutInfo

Calculates and returns layout information based on the available size.
Source§

fn on_event( &mut self, event: &Event, render_info: &Self::RenderInfo, event_context: &mut dyn EventContext<Message>, ) -> EventStatus

Handled the given event.

Auto Trait Implementations§

§

impl<Message, Content, L, R> Freeze for Wrapper<Message, Content, L, R>
where Content: Freeze,

§

impl<Message, Content, L, R> RefUnwindSafe for Wrapper<Message, Content, L, R>
where Content: RefUnwindSafe, Message: RefUnwindSafe,

§

impl<Message, Content, L, R> Send for Wrapper<Message, Content, L, R>
where Content: Send, Message: Send,

§

impl<Message, Content, L, R> Sync for Wrapper<Message, Content, L, R>
where Content: Sync, Message: Sync,

§

impl<Message, Content, L, R> Unpin for Wrapper<Message, Content, L, R>
where Content: Unpin, Message: Unpin,

§

impl<Message, Content, L, R> UnwindSafe for Wrapper<Message, Content, L, R>
where Content: UnwindSafe, Message: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.