pub struct BackendRegistration {
pub id: &'static str,
pub target_id: TargetId,
pub payload_format: Option<&'static str>,
pub reference_oracle: bool,
pub factory: fn() -> Result<Box<dyn VyreBackend>, BackendError>,
pub supported_ops: fn() -> &'static HashSet<OpId>,
pub semantic_operations: fn() -> &'static HashSet<OpId>,
pub target_compiler: Option<fn() -> Result<Box<dyn TargetCompiler>, BackendError>>,
pub materializer: Option<fn() -> Result<Box<dyn ArtifactMaterializer>, BackendError>>,
}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.
target_id: TargetIdValidated target identity owned by the concrete backend crate.
payload_format: Option<&'static str>Stable target-payload format identity owned by the concrete backend.
This is None only when the registration has no target compiler.
reference_oracle: boolWhether this backend is an explicit conformance oracle rather than an eligible production autoroute target.
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>Language-level IR operation IDs accepted by raw backend dispatch.
semantic_operations: fn() -> &'static HashSet<OpId>Canonical semantic operation IDs supported by the target compiler.
This owner-local projection is the target facet submission. The shared
driver joins it with OperationRegistry and never infers semantic
support from language-level node capability.
target_compiler: Option<fn() -> Result<Box<dyn TargetCompiler>, BackendError>>Pure compiler facet for this backend’s immutable target payload.
materializer: Option<fn() -> Result<Box<dyn ArtifactMaterializer>, BackendError>>Device acquisition and immutable payload materialization facet.
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.
Sourcepub fn target_compiler(&self) -> Result<Box<dyn TargetCompiler>, BackendError>
pub fn target_compiler(&self) -> Result<Box<dyn TargetCompiler>, BackendError>
Acquire this backend’s pure target compiler facet.
§Errors
Returns an explicit unsupported-feature error when the linked backend does not provide native target compilation, or a contract error when the constructed compiler disagrees with its registered payload format.
Sourcepub fn materializer(
&self,
) -> Result<Box<dyn ArtifactMaterializer>, BackendError>
pub fn materializer( &self, ) -> Result<Box<dyn ArtifactMaterializer>, BackendError>
Acquire this backend’s device materializer facet.
§Errors
Returns an explicit unsupported-feature error when no native materializer is registered, or the concrete device acquisition error.
Trait Implementations§
Source§impl Clone for BackendRegistration
impl Clone for BackendRegistration
Source§fn clone(&self) -> BackendRegistration
fn clone(&self) -> BackendRegistration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more