pub struct WidgetContext<'a> {
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 view_models: ViewModelCollectionView<'a>,
}
Fields§
§id: &'a WidgetId
§idref: Option<&'a WidgetRef>
§key: &'a str
§props: &'a mut Props
§state: State<'a>
§animator: &'a AnimatorStates
§life_cycle: &'a mut WidgetLifeCycle
§named_slots: HashMap<String, WidgetNode>
§listed_slots: Vec<WidgetNode>
§view_models: ViewModelCollectionView<'a>
Implementations§
source§impl<'a> WidgetContext<'a>
impl<'a> WidgetContext<'a>
pub fn take_named_slots(&mut self) -> HashMap<String, WidgetNode>
pub fn take_named_slot(&mut self, name: &str) -> WidgetNode
pub fn take_listed_slots(&mut self) -> Vec<WidgetNode>
pub fn use_hook<F>(&mut self, f: F) -> &mut Selfwhere
F: FnMut(&mut Self),
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for WidgetContext<'a>
impl<'a> !RefUnwindSafe for WidgetContext<'a>
impl<'a> Send for WidgetContext<'a>
impl<'a> Sync for WidgetContext<'a>
impl<'a> Unpin for WidgetContext<'a>
impl<'a> !UnwindSafe for WidgetContext<'a>
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