View

Struct View 

Source
pub struct View { /* private fields */ }
Expand description

View is your most fundamental building block for laying out and styling components.

§Example

element! {
    View(padding: 2, border_style: BorderStyle::Round) {
        Text(content: "Hello!")
    }
}

Trait Implementations§

Source§

impl Component for View

Source§

type Props<'a> = ViewProps<'a>

The type of properties that the component accepts.
Source§

fn new(_props: &Self::Props<'_>) -> Self

Creates a new instance of the component from a set of properties.
Source§

fn update( &mut self, props: &mut Self::Props<'_>, _hooks: Hooks<'_, '_>, updater: &mut ComponentUpdater<'_, '_, '_>, )

Invoked whenever the properties of the component or layout may have changed.
Source§

fn draw(&mut self, drawer: &mut ComponentDrawer<'_>)

Invoked to draw the component.
Source§

fn poll_change(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<()>

Invoked to determine whether a change has occurred that would require the component to be updated and redrawn.
Source§

impl Default for View

Source§

fn default() -> View

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for View

§

impl RefUnwindSafe for View

§

impl Send for View

§

impl Sync for View

§

impl Unpin for View

§

impl UnwindSafe for View

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> Any for T
where T: Any,

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<C> ElementType for C
where C: Component,

Source§

type Props<'a> = <C as Component>::Props<'a>

The type of the properties that can be passed to the element.
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.