WidgetContext

Struct WidgetContext 

Source
pub struct WidgetContext<T: Widget> { /* private fields */ }

Implementations§

Source§

impl<T: Widget> WidgetContext<T>

Source

pub fn graphics(&mut self) -> Graphics<'_>

Source§

impl<T: Widget> WidgetContext<T>

Source

pub fn live<H>(&mut self) -> Live<'_, T>
where H: AgentHook<Agent = LiveAgent>, T: OnWireEvent<H>,

Source§

impl<T> WidgetContext<T>

Source

pub fn do_action(&mut self, action: <T::Flow as Flow>::Action)

Source

pub fn do_action_of<F: Flow>(&mut self, path: Path, action: F::Action)

SingleFlow mode also compatible with any other actions.

Source

pub fn rewire(&mut self, path: Path)

It unwires automatically.

Source

pub fn unwire(&mut self)

Source§

impl<T> WidgetContext<T>

Source

pub fn rewire_many(&mut self, paths: &HashSet<Path>)

Source§

impl<T: Widget> WidgetContext<T>

Source

pub fn schedule(&mut self, ms: u64, msg: T::Event)

Schedule a timeout.

Note: It’s impossible to move to a separate module, because it requires a link to a Component.

Source

pub fn is_scheduled(&self) -> bool

Source

pub fn unschedule(&mut self)

Source§

impl<T: Widget> WidgetContext<T>

Source

pub fn properties(&self) -> &T::Properties

Source

pub fn meta(&self) -> &T::Meta

Source

pub fn meta_mut(&mut self) -> &mut T::Meta

Source

pub fn redraw(&mut self)

Source

pub fn is_rendered(&self) -> bool

Source

pub fn callback<F, IN>(&self, f: F) -> Callback<IN>
where F: Fn(IN) -> T::Event + 'static,

Source

pub fn event<IN>(&self, msg: impl Into<T::Event>) -> Callback<IN>
where T::Event: Clone,

Source

pub fn notification<IN>(&self) -> Callback<IN>
where T: NotificationHandler<IN>, IN: 'static,

Auto Trait Implementations§

§

impl<T> Freeze for WidgetContext<T>
where <T as Widget>::Properties: Freeze, <T as Widget>::Meta: Freeze,

§

impl<T> !RefUnwindSafe for WidgetContext<T>

§

impl<T> !Send for WidgetContext<T>

§

impl<T> !Sync for WidgetContext<T>

§

impl<T> Unpin for WidgetContext<T>
where <T as Widget>::Properties: Unpin, <T as Widget>::Meta: Unpin,

§

impl<T> !UnwindSafe for WidgetContext<T>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, V> IntoOptPropValue<V> for T
where T: IntoPropValue<Option<V>>,

Source§

fn into_opt_prop_value(self) -> Option<V>

Convert self to an optional value of a Properties struct.
Source§

impl<T> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
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.
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> ErasedDestructor for T
where T: 'static,