pub struct PublishLoan<'a, const TX_BUF: usize> { /* private fields */ }Expand description
Writable loan into a EmbeddedRawPublisher’s slot.
User fills as_mut() then calls commit to publish,
or discard to release the slot without publishing.
Dropping without either silently discards (slot freed); a
#[must_use] warning catches accidental drops at compile time.
Two backings, selected at compile time by the rmw-lending feature:
- Arena (default): per-publisher inline
[u8; TX_BUF]slot. On commit,publish_rawmemcpys into the backend’s outbound buffer. - Backend lending (
rmw-lending): slot owned by the backend (zenoh-pico’s static buffer aliased viaz_bytes_from_static_buf, XRCE’sucdrBufferreservation). True zero-copy publish.
Implementations§
Source§impl<'a, const TX_BUF: usize> PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> PublishLoan<'a, TX_BUF>
Sourcepub fn as_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_mut(&mut self) -> &mut [u8] ⓘ
Mutable view into the loaned bytes. Caller writes message data here.
Trait Implementations§
Auto Trait Implementations§
impl<'a, const TX_BUF: usize> Freeze for PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> !RefUnwindSafe for PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> !Send for PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> !Sync for PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> Unpin for PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> UnsafeUnpin for PublishLoan<'a, TX_BUF>
impl<'a, const TX_BUF: usize> !UnwindSafe for PublishLoan<'a, TX_BUF>
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