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§
Sourcefn publish(
&mut self,
slot_idx: u32,
encoded: &[u8],
) -> Result<(), ProtocolError>
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.
Sourcefn slot_count(&self) -> u32
fn slot_count(&self) -> u32
Number of slots in the underlying ring.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".