pub struct TypedRegistry<T, E> { /* private fields */ }Expand description
Immutable typed registry. Maps type URL → factory.
Created via TypedRegistryBuilder::build. Thread-safe and
shareable via Arc.
Implementations§
Source§impl<T, E> TypedRegistry<T, E>
impl<T, E> TypedRegistry<T, E>
Sourcepub fn create(
&self,
type_url: &str,
value: &Value,
) -> Result<T, RegistryError<E>>
pub fn create( &self, type_url: &str, value: &Value, ) -> Result<T, RegistryError<E>>
Instantiate a value from a type URL and config.
Sourcepub fn create_all(
&self,
entries: &[TypedStruct],
) -> Result<Vec<T>, RegistryError<E>>
pub fn create_all( &self, entries: &[TypedStruct], ) -> Result<Vec<T>, RegistryError<E>>
Instantiate values from a list of typed struct entries.
Auto Trait Implementations§
impl<T, E> Freeze for TypedRegistry<T, E>
impl<T, E> !RefUnwindSafe for TypedRegistry<T, E>
impl<T, E> Send for TypedRegistry<T, E>
impl<T, E> Sync for TypedRegistry<T, E>
impl<T, E> Unpin for TypedRegistry<T, E>
impl<T, E> UnsafeUnpin for TypedRegistry<T, E>
impl<T, E> !UnwindSafe for TypedRegistry<T, E>
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