Skip to main content

FlatWriter

Struct FlatWriter 

Source
pub struct FlatWriter<T: FlatStruct> { /* private fields */ }
Expand description

Schreibt FlatStruct-Samples direkt in SHM-Slots — ohne CDR-Encode.

Implementations§

Source§

impl<T: FlatStruct> FlatWriter<T>

Source

pub fn new( alloc: Arc<InMemorySlotAllocator>, active_readers_mask: ReaderMask, ) -> Self

Erzeugt einen Writer ueber einem Allocator. active_readers_mask listet die Reader-Bits, die alle gelesen haben muessen, bevor ein Slot wiederverwendet werden kann.

Source

pub fn write(&self, sample: &T) -> Result<u32, SlotError>

Spec §8.1 write_flat — reserve + memcpy + commit in einem Call.

§Errors

SlotError::NoFreeSlot bei Resource-Pressure; SampleTooLarge wenn der Slot kleiner als T::WIRE_SIZE ist.

Source

pub fn loan_slot(&self) -> Result<FlatSlot<'_, T>, SlotError>

Spec §8.2 loan_slot — niedrigere Ebene: explizite Slot-Borrow. Caller schreibt direkt in das geliehene &mut T-Buffer und committed.

§Errors

NoFreeSlot.

Auto Trait Implementations§

§

impl<T> Freeze for FlatWriter<T>

§

impl<T> RefUnwindSafe for FlatWriter<T>

§

impl<T> Send for FlatWriter<T>

§

impl<T> Sync for FlatWriter<T>

§

impl<T> Unpin for FlatWriter<T>

§

impl<T> UnsafeUnpin for FlatWriter<T>

§

impl<T> UnwindSafe for FlatWriter<T>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V