pub struct ExtensionRegistry<B: TensorBackend + 'static> { /* private fields */ }Expand description
Registry of backend-specific extension runtime executors.
Implementations§
Source§impl<B: TensorBackend + 'static> ExtensionRegistry<B>
impl<B: TensorBackend + 'static> ExtensionRegistry<B>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty extension runtime registry.
§Examples
use tenferro_runtime::ExtensionRegistry;
use tenferro_cpu::CpuBackend;
let registry = ExtensionRegistry::<CpuBackend>::new();
assert!(!registry.contains("example.identity.v1"));Sourcepub fn register(
&mut self,
executor: Arc<dyn ExtensionRuntime<B>>,
) -> Result<(), ExtensionRuntimeRegistryError>
pub fn register( &mut self, executor: Arc<dyn ExtensionRuntime<B>>, ) -> Result<(), ExtensionRuntimeRegistryError>
Register one runtime executor.
Registration is idempotent by family id: registering the same extension family more than once succeeds and keeps the first runtime. This lets extension crates register their own dependency extensions defensively.
Sourcepub fn get(&self, family_id: &str) -> Option<Arc<dyn ExtensionRuntime<B>>>
pub fn get(&self, family_id: &str) -> Option<Arc<dyn ExtensionRuntime<B>>>
Look up an executor by extension family id.
Trait Implementations§
Source§impl<B: TensorBackend + 'static> Debug for ExtensionRegistry<B>
impl<B: TensorBackend + 'static> Debug for ExtensionRegistry<B>
Source§impl<B: TensorBackend + 'static> Default for ExtensionRegistry<B>
impl<B: TensorBackend + 'static> Default for ExtensionRegistry<B>
Auto Trait Implementations§
impl<B> Freeze for ExtensionRegistry<B>
impl<B> !RefUnwindSafe for ExtensionRegistry<B>
impl<B> Send for ExtensionRegistry<B>
impl<B> Sync for ExtensionRegistry<B>
impl<B> Unpin for ExtensionRegistry<B>
impl<B> UnsafeUnpin for ExtensionRegistry<B>
impl<B> !UnwindSafe for ExtensionRegistry<B>
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