Skip to main content

LinuxViewDefinition

Struct LinuxViewDefinition 

Source
pub struct LinuxViewDefinition<W> { /* private fields */ }
Expand description

The View { Prop / Events / Command } portion of a Linux declaration.

Implementations§

Source§

impl<W> LinuxViewDefinition<W>
where W: LinuxView,

Source

pub fn new( name: impl Into<String>, create: impl Fn(LinuxEventEmitter) -> W + 'static, ) -> Self

Declares how the widget is created for each mounted node.

Source

pub fn prop( self, property: impl Into<String>, set: impl Fn(&W, &WhiskerValue) + 'static, clear: impl Fn(&W) + 'static, ) -> Self

Declares one property by its stable Host name.

Source

pub fn event(self, event: impl Into<String>) -> Self

Declares one event by its stable Host name.

Source

pub fn command( self, command: impl Into<String>, handler: impl Fn(&W, &WhiskerValue) + 'static, ) -> Self

Declares one command by its stable Host name.

Source

pub fn text_style( self, update: impl Fn(&W, &TextStyleSnapshot) + 'static, ) -> Self

Receives the resolved inherited text style.

Source

pub fn measure( self, measure: impl Fn(&ModuleMeasureRequest) -> Option<MeasuredSize> + 'static, ) -> Self

Returns the intrinsic size, or None when the request is unsupported.

Auto Trait Implementations§

§

impl<W> !RefUnwindSafe for LinuxViewDefinition<W>

§

impl<W> !Send for LinuxViewDefinition<W>

§

impl<W> !Sync for LinuxViewDefinition<W>

§

impl<W> !UnwindSafe for LinuxViewDefinition<W>

§

impl<W> Forget for LinuxViewDefinition<W>

§

impl<W> Freeze for LinuxViewDefinition<W>
where Rc<dyn Fn(LinuxEventEmitter) -> W>: Freeze, ViewBindings<W>: Freeze,

§

impl<W> Move for LinuxViewDefinition<W>

§

impl<W> Unpin for LinuxViewDefinition<W>
where Rc<dyn Fn(LinuxEventEmitter) -> W>: Unpin, ViewBindings<W>: Unpin,

§

impl<W> UnsafeUnpin for LinuxViewDefinition<W>
where Rc<dyn Fn(LinuxEventEmitter) -> W>: UnsafeUnpin, ViewBindings<W>: UnsafeUnpin,

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.