pub struct ChildNameScope { /* private fields */ }Expand description
A name scope nested in another one: names that are not found once the scope is complete are looked up in the parent scope.
Implementations§
Source§impl ChildNameScope
impl ChildNameScope
pub fn new(parent_scope: NameScopeRef) -> Self
Trait Implementations§
Source§impl INameScope for ChildNameScope
impl INameScope for ChildNameScope
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.Auto Trait Implementations§
impl !Freeze for ChildNameScope
impl !RefUnwindSafe for ChildNameScope
impl !Send for ChildNameScope
impl !Sync for ChildNameScope
impl !UnwindSafe for ChildNameScope
impl Unpin for ChildNameScope
impl UnsafeUnpin for ChildNameScope
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