pub struct BackendRegistration {
pub id: &'static str,
pub factory: fn() -> Result<Box<dyn VyreBackend>, BackendError>,
pub supported_ops: fn() -> &'static HashSet<OpId>,
}Expand description
One backend constructor contributed by a linked backend crate.
Backend construction can fail (missing GPU adapter, unsupported driver),
so the factory returns a BackendError rather than panicking. Callers
iterate registered_backends and skip backends whose factory fails on
this host.
Fields§
§id: &'static strStable backend identifier, matching VyreBackend::id.
factory: fn() -> Result<Box<dyn VyreBackend>, BackendError>Factory that constructs the backend implementation.
Returns Err(BackendError) when the backend cannot initialize on
this host. The error message must include a Fix: remediation section
per the frozen BackendError contract.
supported_ops: fn() -> &'static HashSet<OpId>Operation ids supported by this backend.
Implementations§
Source§impl BackendRegistration
impl BackendRegistration
Sourcepub fn acquire(&self) -> Result<Box<dyn VyreBackend>, BackendError>
pub fn acquire(&self) -> Result<Box<dyn VyreBackend>, BackendError>
Construct this registered backend through the shared driver boundary.
This preserves the raw factory ABI while ensuring registration-based
callers receive the same dispatch wrapper as crate::backend::acquire
and crate::backend::acquire_preferred_dispatch_backend.
§Errors
Returns the backend factory error when the concrete backend cannot initialize on this host.