pub struct NameScope { /* private fields */ }Expand description
Implements a name scope.
Implementations§
Source§impl NameScope
impl NameScope
Sourcepub fn name_scope_property() -> &'static AttachedProperty<Option<NameScopeRef>>
pub fn name_scope_property() -> &'static AttachedProperty<Option<NameScopeRef>>
Defines the NameScope attached property.
Source§impl NameScope
impl NameScope
pub fn new() -> Self
Sourcepub fn get_name_scope(styled: &StyledElement) -> Option<NameScopeRef>
pub fn get_name_scope(styled: &StyledElement) -> Option<NameScopeRef>
Gets the value of the attached NameScope property on a styled element.
Sourcepub fn set_name_scope(styled: &StyledElement, value: Option<NameScopeRef>)
pub fn set_name_scope(styled: &StyledElement, value: Option<NameScopeRef>)
Sets the value of the attached NameScope property on a styled element.
The scope is told which element holds it, and the scope the element
held before that it no longer does (see INameScope::attached_to).
Trait Implementations§
Source§impl INameScope for NameScope
impl INameScope for NameScope
Source§fn try_register(
&self,
name: &str,
element: Ref<FerroObject>,
) -> Result<(), NameScopeError>
fn try_register( &self, name: &str, element: Ref<FerroObject>, ) -> Result<(), NameScopeError>
Registers an element in the name scope, reporting a completed scope
and a name that another element is registered with as errors.
Registering an element again with its name does nothing.
Source§fn find_async(
&self,
name: &str,
) -> SynchronousCompletionAsyncResult<Option<Ref<FerroObject>>>
fn find_async( &self, name: &str, ) -> SynchronousCompletionAsyncResult<Option<Ref<FerroObject>>>
Finds a named element in the name scope, waits for the scope to be
completely populated before returning
None. Returned results always
complete synchronously.Source§fn find(&self, name: &str) -> Option<Ref<FerroObject>>
fn find(&self, name: &str) -> Option<Ref<FerroObject>>
Finds a named element in the name scope, returns immediately, doesn’t
traverse the name scope stack.
Source§fn complete(&self)
fn complete(&self)
Marks the name scope as completed, no further registrations will be
allowed.
Source§fn is_completed(&self) -> bool
fn is_completed(&self) -> bool
Whether the name scope is completed, no further registrations are
allowed.
Source§fn attached_to(&self, owner: &Ref<FerroObject>)
fn attached_to(&self, owner: &Ref<FerroObject>)
The scope became the value of the attached
NameScope property of
owner, which holds it from now on. Not a member of the managed
original: there the scope and the element hold each other and the
collector frees both; here the scope holds this one element weakly
(it finds it as long as it is alive). A scope that holds no elements
itself has nothing to do.Source§fn detached_from(&self, owner: &Ref<FerroObject>)
fn detached_from(&self, owner: &Ref<FerroObject>)
The scope is no longer the value of the attached
NameScope
property of owner: it holds the element as every other again.Source§fn register(&self, name: &str, element: Ref<FerroObject>)
fn register(&self, name: &str, element: Ref<FerroObject>)
Registers an element in the name scope. Panics if the scope is
completed or another element is registered with the name: see
try_register for the form that reports these
as errors.Source§impl MarkupTyped for NameScope
impl MarkupTyped for NameScope
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
The markup metadata of the type.
Auto Trait Implementations§
impl !Freeze for NameScope
impl !RefUnwindSafe for NameScope
impl !Send for NameScope
impl !Sync for NameScope
impl !UnwindSafe for NameScope
impl Unpin for NameScope
impl UnsafeUnpin for NameScope
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more