pub struct GuidPrefix(pub [u8; 12]);Expand description
GuidPrefix: 12-byte prefix of a GUID. Identifies a
participant; stays the same for all endpoints of the participant.
Tuple Fields§
§0: [u8; 12]Implementations§
Source§impl GuidPrefix
impl GuidPrefix
Sourcepub fn from_bytes(bytes: [u8; 12]) -> Self
pub fn from_bytes(bytes: [u8; 12]) -> Self
Bytes unchanged.
Sourcepub fn host_id(self) -> [u8; 4]
pub fn host_id(self) -> [u8; 4]
ZeroDDS convention (Spec zerodds-zero-copy-1.0 §6 wave 4):
the first 4 bytes of the GuidPrefix carry a deterministic
host identifier (hash of the gethostname output). Two
participants with an identical host-id prefix run on the
same machine and can set up a same-host zero-copy path.
The RTPS 2.5 spec §9.3.1.5 allows vendor-specific structuring of the first 8 bytes (vendor-specific); only the comparison semantics of the full 12 bytes is normative.
Sourcepub fn is_same_host(self, other: Self) -> bool
pub fn is_same_host(self, other: Self) -> bool
Returns true if both participants carry the same host-id
prefix. See Self::host_id.
Trait Implementations§
Source§impl Clone for GuidPrefix
impl Clone for GuidPrefix
Source§fn clone(&self) -> GuidPrefix
fn clone(&self) -> GuidPrefix
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 moreimpl Copy for GuidPrefix
Source§impl Debug for GuidPrefix
impl Debug for GuidPrefix
impl Eq for GuidPrefix
Source§impl Hash for GuidPrefix
impl Hash for GuidPrefix
Source§impl Ord for GuidPrefix
impl Ord for GuidPrefix
Source§fn cmp(&self, other: &GuidPrefix) -> Ordering
fn cmp(&self, other: &GuidPrefix) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GuidPrefix
impl PartialEq for GuidPrefix
Source§fn eq(&self, other: &GuidPrefix) -> bool
fn eq(&self, other: &GuidPrefix) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for GuidPrefix
impl PartialOrd for GuidPrefix
impl StructuralPartialEq for GuidPrefix
Auto Trait Implementations§
impl Freeze for GuidPrefix
impl RefUnwindSafe for GuidPrefix
impl Send for GuidPrefix
impl Sync for GuidPrefix
impl Unpin for GuidPrefix
impl UnsafeUnpin for GuidPrefix
impl UnwindSafe for GuidPrefix
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