pub struct AnyScope { /* private fields */ }
Expand description
Untyped scope used for accessing parent scope
Implementations§
source§impl AnyScope
impl AnyScope
sourcepub fn get_parent(&self) -> Option<&AnyScope>
pub fn get_parent(&self) -> Option<&AnyScope>
Returns the parent scope
sourcepub fn get_type_id(&self) -> &TypeId
pub fn get_type_id(&self) -> &TypeId
Returns the type of the linked component
sourcepub fn downcast<COMP: BaseComponent>(&self) -> Scope<COMP>
pub fn downcast<COMP: BaseComponent>(&self) -> Scope<COMP>
Attempts to downcast into a typed scope
Panics
If the self value can’t be cast into the target type.
sourcepub fn try_downcast<COMP: BaseComponent>(&self) -> Option<Scope<COMP>>
pub fn try_downcast<COMP: BaseComponent>(&self) -> Option<Scope<COMP>>
Attempts to downcast into a typed scope
Returns None
if the self value can’t be cast into the target type.
sourcepub fn find_parent_scope<COMP: BaseComponent>(&self) -> Option<Scope<COMP>>
pub fn find_parent_scope<COMP: BaseComponent>(&self) -> Option<Scope<COMP>>
Attempts to find a parent scope of a certain type
Returns None
if no parent scope with the specified type was found.