pub struct OutputSample<'a> { /* private fields */ }Expand description
A reserved write buffer for one message.
Implementations§
Source§impl<'a> OutputSample<'a>
impl<'a> OutputSample<'a>
Sourcepub fn shm(
window: SampleMut<'a>,
shared: Arc<SessionShared>,
output: DataId,
segment: Option<(String, u64)>,
) -> Self
pub fn shm( window: SampleMut<'a>, shared: Arc<SessionShared>, output: DataId, segment: Option<(String, u64)>, ) -> Self
A sample backed by a ring slot.
Sourcepub fn heap(bytes: Vec<u8>, shared: Arc<SessionShared>, output: DataId) -> Self
pub fn heap(bytes: Vec<u8>, shared: Arc<SessionShared>, output: DataId) -> Self
A sample backed by an owned heap buffer.
Sourcepub const fn is_zero_copy(&self) -> bool
pub const fn is_zero_copy(&self) -> bool
Whether writing here copies nothing.
Sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
The writable bytes.
On the zero-copy plane the slice base is 128-byte aligned (§6.1), so an Arrow IPC message serialised straight into it is directly usable as a SIMD source by every consumer.
Sourcepub fn sequence(&self) -> Option<u64>
pub fn sequence(&self) -> Option<u64>
The sequence number this window will publish, on the zero-copy plane.
Sourcepub fn truncate(&mut self, len: usize) -> Result<()>
pub fn truncate(&mut self, len: usize) -> Result<()>
Shortens the buffer to len bytes.
The encoder that reserved a generous window and produced less keeps the zero-copy path rather than falling back to a copy.
§Errors
crate::NodeError::Shm when len is longer than the window.
Sourcepub fn send(self, metadata: Metadata) -> Result<()>
pub fn send(self, metadata: Metadata) -> Result<()>
Publishes the message.
§Errors
crate::NodeError::DaemonGone once the session has ended, and
crate::NodeError::Wire when the metadata cannot be encoded.