Skip to main content

BackendRegistration

Struct BackendRegistration 

Source
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 str

Stable backend identifier, matching VyreBackend::id.

§target_id: TargetId

Validated 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: bool

Whether 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

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> BackendRegistration

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Collect for BackendRegistration

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more