#[repr(C)]pub struct LlmpMsg {
pub tag: Tag,
pub sender: ClientId,
pub broker: BrokerId,
pub flags: Flags,
pub message_id: MessageId,
pub buf_len: u64,
pub buf_len_padded: u64,
pub buf: [u8; 0],
}
Expand description
Message sent over the “wire”
Fields
tag: Tag
A tag
sender: ClientId
Sender of this message
broker: BrokerId
ID of another Broker, for b2b messages
flags: Flags
flags, currently only used for indicating compression
message_id: MessageId
The message ID, unique per page
buf_len: u64
Buffer length as specified by the user
buf_len_padded: u64
(Actual) buffer length after padding
buf: [u8; 0]
The actual payload buf
Implementations
sourceimpl LlmpMsg
impl LlmpMsg
The message we receive
sourcepub unsafe fn as_slice_unsafe(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub unsafe fn as_slice_unsafe(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Gets the buffer from this message as slice, with the corrent length.
Safety
This is unsafe if somebody has access to shared mem pages on the system.
sourcepub fn try_as_slice<SHM: ShMem>(
&self,
map: &mut LlmpSharedMap<SHM>
) -> Result<&[u8], Error>
pub fn try_as_slice<SHM: ShMem>(
&self,
map: &mut LlmpSharedMap<SHM>
) -> Result<&[u8], Error>
Gets the buffer from this message as slice, with the corrent length.
sourcepub fn in_shmem<SHM: ShMem>(&self, map: &mut LlmpSharedMap<SHM>) -> bool
pub fn in_shmem<SHM: ShMem>(&self, map: &mut LlmpSharedMap<SHM>) -> bool
Returns true, if the pointer is, indeed, in the page of this shared map.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LlmpMsg
impl Send for LlmpMsg
impl Sync for LlmpMsg
impl Unpin for LlmpMsg
impl UnwindSafe for LlmpMsg
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
sourceimpl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
type PreprendResult = Tail
type PreprendResult = Tail
The Resulting TupleList
, of an Prepend::prepend()
call,
including the prepended entry. Read more
sourcefn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.