pub struct WriterRegion<M> { /* private fields */ }Expand description
Mapping-lifetime owner that prevents duplicate safe writer binding.
Implementations§
Source§impl<M: SoleWriterMapping> WriterRegion<M>
impl<M: SoleWriterMapping> WriterRegion<M>
Sourcepub fn new(
mapping: M,
layout: ValidatedRegionLayout,
topology: RegionSetLayout,
) -> Result<Self, (M, BindingError)>
pub fn new( mapping: M, layout: ValidatedRegionLayout, topology: RegionSetLayout, ) -> Result<Self, (M, BindingError)>
Consumes a platform-minted unique writer witness.
On rejection, returns the witness alongside the error so the caller recovers the mapping instead of losing it.
Sourcepub fn into_mapping(self) -> M
pub fn into_mapping(self) -> M
Releases the binding and returns the owned mapping witness.
Sourcepub fn slot(&mut self, slot: u32) -> Result<WriterSlot<'_>, BindingError>
pub fn slot(&mut self, slot: u32) -> Result<WriterSlot<'_>, BindingError>
Exclusively binds one checked producer slot.
Sourcepub fn publish(
&mut self,
slot: u32,
sequence: u64,
acknowledgement: Option<AcknowledgementObservation>,
payload: &[u8],
) -> Result<(), BindingError>
pub fn publish( &mut self, slot: u32, sequence: u64, acknowledgement: Option<AcknowledgementObservation>, payload: &[u8], ) -> Result<(), BindingError>
Copies an owned caller payload into a checked slot and publishes it.
Sourcepub fn acknowledgement(
&mut self,
target: RoleId,
slot: u32,
) -> Result<AcknowledgementWriter<'_>, BindingError>
pub fn acknowledgement( &mut self, target: RoleId, slot: u32, ) -> Result<AcknowledgementWriter<'_>, BindingError>
Exclusively binds one checked acknowledgement cell.
Auto Trait Implementations§
impl<M> Freeze for WriterRegion<M>where
M: Freeze,
impl<M> RefUnwindSafe for WriterRegion<M>where
M: RefUnwindSafe,
impl<M> Send for WriterRegion<M>where
M: Send,
impl<M> Sync for WriterRegion<M>where
M: Sync,
impl<M> Unpin for WriterRegion<M>where
M: Unpin,
impl<M> UnsafeUnpin for WriterRegion<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for WriterRegion<M>where
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more