pub struct ShmLocator {
pub hostname_hash: u32,
pub uid: u32,
pub slot_count: u32,
pub slot_size: u32,
pub segment_path: String,
}Expand description
SHM locator: all the data a same-host reader needs to attach to a writer SHM segment.
Fields§
§hostname_hash: u32FNV-1a hash of the hostname. Same-host match anchor.
uid: u32POSIX UID of the writer process. Prevents cross-user attaches on shared hosts.
slot_count: u32Number of slots in the segment.
slot_size: u32Total slot size (header + data + padding).
segment_path: StringSHM segment path (e.g. /zddspub_<entity_id>).
Implementations§
Source§impl ShmLocator
impl ShmLocator
Sourcepub fn to_bytes_le(&self) -> Result<Vec<u8>, LocatorError>
pub fn to_bytes_le(&self) -> Result<Vec<u8>, LocatorError>
Encodes little-endian. For the layout, see the module docs.
§Errors
PathTooLong when segment_path.len() > 256.
Sourcepub fn from_bytes_le(bytes: &[u8]) -> Result<Self, LocatorError>
pub fn from_bytes_le(bytes: &[u8]) -> Result<Self, LocatorError>
Decodes from little-endian bytes.
§Errors
TruncatedHeader, TruncatedString, InvalidUtf8, PathTooLong.
Trait Implementations§
Source§impl Clone for ShmLocator
impl Clone for ShmLocator
Source§fn clone(&self) -> ShmLocator
fn clone(&self) -> ShmLocator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShmLocator
impl Debug for ShmLocator
impl Eq for ShmLocator
Source§impl PartialEq for ShmLocator
impl PartialEq for ShmLocator
Source§fn eq(&self, other: &ShmLocator) -> bool
fn eq(&self, other: &ShmLocator) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ShmLocator
Auto Trait Implementations§
impl Freeze for ShmLocator
impl RefUnwindSafe for ShmLocator
impl Send for ShmLocator
impl Sync for ShmLocator
impl Unpin for ShmLocator
impl UnsafeUnpin for ShmLocator
impl UnwindSafe for ShmLocator
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