pub struct HostBackendRegistry { /* private fields */ }Expand description
Deterministic registry of host stream backends.
Implementations§
Source§impl HostBackendRegistry
impl HostBackendRegistry
Sourcepub fn register<B>(&mut self, backend: B) -> Result<()>where
B: HostBackend + 'static,
pub fn register<B>(&mut self, backend: B) -> Result<()>where
B: HostBackend + 'static,
Registers a backend by its stable backend id.
Sourcepub fn register_arc(&mut self, backend: Arc<dyn HostBackend>) -> Result<()>
pub fn register_arc(&mut self, backend: Arc<dyn HostBackend>) -> Result<()>
Registers an already shared backend.
Sourcepub fn backend(&self, id: &Symbol) -> Option<Arc<dyn HostBackend>>
pub fn backend(&self, id: &Symbol) -> Option<Arc<dyn HostBackend>>
Returns a registered backend by id.
Sourcepub fn enumerate(&self) -> Result<Vec<HostDeviceInventory>>
pub fn enumerate(&self) -> Result<Vec<HostDeviceInventory>>
Enumerates every registered backend.
Sourcepub fn open(&self, request: HostStreamConfigRequest) -> Result<HostOpenStream>
pub fn open(&self, request: HostStreamConfigRequest) -> Result<HostOpenStream>
Opens a stream using the backend named in the request.
Sourcepub fn card_exprs(&self) -> Result<Vec<Expr>>
pub fn card_exprs(&self) -> Result<Vec<Expr>>
Emits backend, device, and port browse card expressions.
Sourcepub fn missing_capability_card(
&self,
backend: &Symbol,
capability: HostBackendCapability,
) -> Expr
pub fn missing_capability_card( &self, backend: &Symbol, capability: HostBackendCapability, ) -> Expr
Emits a browse card for a missing backend capability.
Trait Implementations§
Source§impl Default for HostBackendRegistry
impl Default for HostBackendRegistry
Source§fn default() -> HostBackendRegistry
fn default() -> HostBackendRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for HostBackendRegistry
impl !UnwindSafe for HostBackendRegistry
impl Freeze for HostBackendRegistry
impl Send for HostBackendRegistry
impl Sync for HostBackendRegistry
impl Unpin for HostBackendRegistry
impl UnsafeUnpin for HostBackendRegistry
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