Skip to main content

ChildNameScope

Struct ChildNameScope 

Source
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

Source

pub fn new(parent_scope: NameScopeRef) -> Self

Trait Implementations§

Source§

impl INameScope for ChildNameScope

Source§

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>>>

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>>

Finds a named element in the name scope, returns immediately, doesn’t traverse the name scope stack.
Source§

fn complete(&self)

Marks the name scope as completed, no further registrations will be allowed.
Source§

fn is_completed(&self) -> bool

Whether the name scope is completed, no further registrations are allowed.
Source§

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>)

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>)

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.