Struct WidgetContext

Source
pub struct WidgetContext<'a, 'b> {
    pub id: &'a WidgetId,
    pub idref: Option<&'a WidgetRef>,
    pub key: &'a str,
    pub props: &'a mut Props,
    pub shared_props: &'a mut Props,
    pub state: State<'a>,
    pub animator: &'a AnimatorStates,
    pub life_cycle: &'a mut WidgetLifeCycle,
    pub named_slots: HashMap<String, WidgetNode>,
    pub listed_slots: Vec<WidgetNode>,
    pub process_context: &'a mut ProcessContext<'b>,
}

Fields§

§id: &'a WidgetId§idref: Option<&'a WidgetRef>§key: &'a str§props: &'a mut Props§shared_props: &'a mut Props§state: State<'a>§animator: &'a AnimatorStates§life_cycle: &'a mut WidgetLifeCycle§named_slots: HashMap<String, WidgetNode>§listed_slots: Vec<WidgetNode>§process_context: &'a mut ProcessContext<'b>

Implementations§

Source§

impl<'a, 'b> WidgetContext<'a, 'b>

Source

pub fn take_named_slots(&mut self) -> HashMap<String, WidgetNode>

Source

pub fn take_named_slot(&mut self, name: &str) -> WidgetNode

Source

pub fn take_listed_slots(&mut self) -> Vec<WidgetNode>

Source

pub fn use_hook<F>(&mut self, f: F) -> &mut WidgetContext<'a, 'b>
where F: FnMut(&mut WidgetContext<'a, 'b>),

Trait Implementations§

Source§

impl<'a, 'b> Debug for WidgetContext<'a, 'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for WidgetContext<'a, 'b>

§

impl<'a, 'b> !RefUnwindSafe for WidgetContext<'a, 'b>

§

impl<'a, 'b> !Send for WidgetContext<'a, 'b>

§

impl<'a, 'b> !Sync for WidgetContext<'a, 'b>

§

impl<'a, 'b> Unpin for WidgetContext<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for WidgetContext<'a, 'b>

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

Source§

unsafe fn finalize_raw(data: *mut ())

Safety 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 = 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.