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,
impl<W> LinuxViewDefinition<W>where
W: LinuxView,
Sourcepub fn new(
name: impl Into<String>,
create: impl Fn(LinuxEventEmitter) -> W + 'static,
) -> Self
pub fn new( name: impl Into<String>, create: impl Fn(LinuxEventEmitter) -> W + 'static, ) -> Self
Declares how the widget is created for each mounted node.
Sourcepub fn prop(
self,
property: impl Into<String>,
set: impl Fn(&W, &WhiskerValue) + 'static,
clear: impl Fn(&W) + 'static,
) -> Self
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.
Sourcepub fn event(self, event: impl Into<String>) -> Self
pub fn event(self, event: impl Into<String>) -> Self
Declares one event by its stable Host name.
Sourcepub fn command(
self,
command: impl Into<String>,
handler: impl Fn(&W, &WhiskerValue) + 'static,
) -> Self
pub fn command( self, command: impl Into<String>, handler: impl Fn(&W, &WhiskerValue) + 'static, ) -> Self
Declares one command by its stable Host name.
Sourcepub fn text_style(
self,
update: impl Fn(&W, &TextStyleSnapshot) + 'static,
) -> Self
pub fn text_style( self, update: impl Fn(&W, &TextStyleSnapshot) + 'static, ) -> Self
Receives the resolved inherited text style.
Sourcepub fn measure(
self,
measure: impl Fn(&ModuleMeasureRequest) -> Option<MeasuredSize> + 'static,
) -> Self
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>
impl<W> Move for LinuxViewDefinition<W>
impl<W> Unpin for LinuxViewDefinition<W>
impl<W> UnsafeUnpin for LinuxViewDefinition<W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more