Skip to main content

MultiEmitterBackend

Struct MultiEmitterBackend 

Source
pub struct MultiEmitterBackend {
    pub target: Target,
    pub general: Box<dyn TargetEmitter>,
    pub specialist: Option<Box<dyn TargetEmitter>>,
    pub quorum_policy: QuorumPolicy,
}
Expand description

Multi-emitter backend wrapper. Composes a general emitter (mandatory) + an optional specialist under a QuorumPolicy. Implements Backend so it slots into the existing dispatch without touching TranspileSession.

Fields§

§target: Target

Single target this multi-emitter backend serves (e.g., Target::Ptx).

§general: Box<dyn TargetEmitter>

Mandatory general emitter. Must handle any contract-conforming input as a fallback.

§specialist: Option<Box<dyn TargetEmitter>>

Optional specialist emitter. Returns None from try_emit when its shape filter doesn’t match the input.

§quorum_policy: QuorumPolicy

How to combine outputs when both emitters fire.

Implementations§

Source§

impl MultiEmitterBackend

Source

pub fn new_single(target: Target, general: Box<dyn TargetEmitter>) -> Self

Source

pub fn new_with_specialist( target: Target, general: Box<dyn TargetEmitter>, specialist: Box<dyn TargetEmitter>, quorum_policy: QuorumPolicy, ) -> Self

Trait Implementations§

Source§

impl Backend for MultiEmitterBackend

Source§

fn name(&self) -> &'static str

Human-readable backend name, e.g. “rust”, “ptx”, “wgsl”.
Source§

fn targets(&self) -> &[Target]

Targets this backend can emit. Each Target variant is owned by exactly one Backend impl (target_ownership invariant).
Source§

fn lower( &self, module: &Module, config: &BackendConfig, ) -> Result<Artifact, BackendError>

Lower a meta-HIR module under the given config to an Artifact. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.