Skip to main content

RingProducer

Trait RingProducer 

Source
pub trait RingProducer {
    // Required methods
    fn publish(
        &mut self,
        slot_idx: u32,
        encoded: &[u8],
    ) -> Result<(), ProtocolError>;
    fn slot_count(&self) -> u32;
    fn name(&self) -> &'static str;
}
Expand description

Producer half of the megakernel ring contract.

Implementations write encoded slot bytes (from protocol::encode_load_miss et al.) into a ring of slot_count fixed-size slots. The mapping from logical slot index to physical storage is the implementation’s concern; consumers only see slot indices and the byte layout the protocol module defines.

Required Methods§

Source

fn publish( &mut self, slot_idx: u32, encoded: &[u8], ) -> Result<(), ProtocolError>

Publish encoded into slot_idx. encoded must be exactly SLOT_BYTES long; otherwise returns ProtocolError::MisalignedByteLength.

Source

fn slot_count(&self) -> u32

Number of slots in the underlying ring.

Source

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

Stable identifier for telemetry (e.g. "in-process-host", "uring-cmd-nvme", "gds").

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§