pub enum FnWidget {
Pointer(fn(_: WidgetContext<'_>) -> WidgetNode),
Closure(Arc<dyn Fn(WidgetContext<'_>) -> WidgetNode + Send + Sync>),
}
Variants§
Pointer(fn(_: WidgetContext<'_>) -> WidgetNode)
Closure(Arc<dyn Fn(WidgetContext<'_>) -> WidgetNode + Send + Sync>)
Implementations§
source§impl FnWidget
impl FnWidget
pub fn pointer(value: fn(_: WidgetContext<'_>) -> WidgetNode) -> Self
pub fn closure( value: impl Fn(WidgetContext<'_>) -> WidgetNode + Send + Sync + 'static, ) -> Self
pub fn call(&self, context: WidgetContext<'_>) -> WidgetNode
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FnWidget
impl !RefUnwindSafe for FnWidget
impl Send for FnWidget
impl Sync for FnWidget
impl Unpin for FnWidget
impl !UnwindSafe for FnWidget
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)