pub struct Registry { /* private fields */ }Expand description
Collects definitions while a type registers itself and what it refers to.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn into_definitions(self) -> Definitions
pub fn into_definitions(self) -> Definitions
The definitions collected so far.
Sourcepub fn reserve(
&mut self,
name: &str,
id: TypeId,
type_name: &'static str,
) -> bool
pub fn reserve( &mut self, name: &str, id: TypeId, type_name: &'static str, ) -> bool
Reserves name for the type id, called type_name in messages. Returns whether the caller is the first to
reach it and so must call Registry::define and register what it refers to; a recursive type is reserved
before its fields are visited.
§Panics
When name is already reserved by a different type, naming both, because a definition is looked up by name
and one of the two would otherwise be silently replaced by the other.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Registry
impl Freeze for Registry
impl Move for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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