pub struct FrameData { /* private fields */ }Implementations
sourceimpl FrameData
impl FrameData
pub fn new(
kind: FrameKind,
sender: Option<String>,
topic: Option<String>,
header: Option<Vec<u8>>,
buf: Vec<u8>,
payload_pos: usize,
realtime: bool
) -> Self
pub fn new_nop() -> Self
pub fn kind(&self) -> FrameKind
sourcepub fn payload(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn payload(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
To keep zero-copy model, frames contain the full incoming buffer + actual payload position. Use this method to get the actual call payload.
sourcepub fn header(&self) -> Option<&[u8]>
pub fn header(&self) -> Option<&[u8]>
The header can be used by certain implementations (e.g. the default RPC layer) to keep zero-copy model. The header is None for IPC communications, but filled for inter-thread ones. A custom layer should use/parse the header to avoid unnecessary payload copy
pub fn is_realtime(&self) -> bool
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FrameData
impl Send for FrameData
impl Sync for FrameData
impl Unpin for FrameData
impl UnwindSafe for FrameData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more