[−][src]Struct orbtk_api::widget_base::StatesContext
The StatesContext
provides access to the widget states.
Implementations
impl<'a> StatesContext<'a>
[src]
pub fn new(
states: &'a mut BTreeMap<Entity, Box<dyn State>>,
ecm: &'a mut EntityComponentManager<Tree, StringComponentStore>
) -> Self
[src]
states: &'a mut BTreeMap<Entity, Box<dyn State>>,
ecm: &'a mut EntityComponentManager<Tree, StringComponentStore>
) -> Self
Creates a new state context.
pub fn get<S: Component>(&self, entity: Entity) -> &S
[src]
Gets the state of the given widget.
Panics
Panics if the there is no state for the given entity or the given state type is wrong.
pub fn get_mut<S: Component>(&mut self, entity: Entity) -> &mut S
[src]
Gets a mutable state of the given widget.
Panics
Panics if the there is no state for the given entity or the given state type is wrong.
pub fn try_get<S: Component>(&self, entity: Entity) -> Option<&S>
[src]
Try to get the state of the given widget.
pub fn try_get_mut<S: Component>(&mut self, entity: Entity) -> Option<&mut S>
[src]
Try to get a mutable reference of the state of the given widget.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for StatesContext<'a>
impl<'a> !Send for StatesContext<'a>
impl<'a> !Sync for StatesContext<'a>
impl<'a> Unpin for StatesContext<'a>
impl<'a> !UnwindSafe for StatesContext<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<E> Component for E where
E: Any,
[src]
E: Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,