Struct Decorated

Source
pub struct Decorated<V, D> {
    pub view: V,
    pub decorator: D,
}
Expand description

Represents a particular view V, decorated by a decorator D.

Fields§

§view: V§decorator: D

Implementations§

Source§

impl<V, D> Decorated<V, D>

Source

pub fn new(view: V, decorator: D) -> Self

Trait Implementations§

Source§

impl<T, V: View<T> + ViewSize<T>> View<T> for Decorated<V, Align>

Source§

fn view<G: ViewGrid>( &mut self, data: &T, offset: Coord, depth: i32, grid: &mut G, )

Update the cells in grid to describe how a type should be rendered. This mutably borrows self to allow the view to contain buffers/caches which are updated during rendering.
Source§

impl<T: ?Sized, V: View<T> + ViewSize<T>> View<T> for Decorated<V, Border>

Source§

fn view<G: ViewGrid>( &mut self, data: &T, offset: Coord, depth: i32, grid: &mut G, )

Update the cells in grid to describe how a type should be rendered. This mutably borrows self to allow the view to contain buffers/caches which are updated during rendering.
Source§

impl<T, V: View<T> + ViewSize<T>> ViewSize<T> for Decorated<V, Align>

Source§

fn size(&mut self, data: &T) -> Size

Returns the size in cells of the rectangle containing a ui element. This allows for the implementation of decorator ui components that render a border around some inner element.
Source§

impl<T: ?Sized, V: View<T> + ViewSize<T>> ViewSize<T> for Decorated<V, Border>

Source§

fn size(&mut self, data: &T) -> Size

Returns the size in cells of the rectangle containing a ui element. This allows for the implementation of decorator ui components that render a border around some inner element.

Auto Trait Implementations§

§

impl<V, D> Freeze for Decorated<V, D>
where V: Freeze, D: Freeze,

§

impl<V, D> RefUnwindSafe for Decorated<V, D>

§

impl<V, D> Send for Decorated<V, D>
where V: Send, D: Send,

§

impl<V, D> Sync for Decorated<V, D>
where V: Sync, D: Sync,

§

impl<V, D> Unpin for Decorated<V, D>
where V: Unpin, D: Unpin,

§

impl<V, D> UnwindSafe for Decorated<V, D>
where V: UnwindSafe, D: 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.