pub struct PointerOffset(/* private fields */);Expand description
An offset to a SharedMemory address. It requires the
SharedMemory::payload_start_address()
of the corresponding SharedMemory to be converted into
an actual pointer.
Contains the offset and the corresponding SegmentId.
Implementations§
Source§impl PointerOffset
impl PointerOffset
Sourcepub const fn new(offset: usize) -> PointerOffset
pub const fn new(offset: usize) -> PointerOffset
Creates a new PointerOffset from the given offset value with the SegmentId == 0.
Sourcepub const fn from_offset_and_segment_id(
offset: usize,
segment_id: SegmentId,
) -> PointerOffset
pub const fn from_offset_and_segment_id( offset: usize, segment_id: SegmentId, ) -> PointerOffset
Creates a new PointerOffset from an offset and a SegmentId
Sourcepub const fn from_value(value: u64) -> PointerOffset
pub const fn from_value(value: u64) -> PointerOffset
Creates a new PointerOffset from a provided raw value.
Sourcepub const fn as_value(&self) -> u64
pub const fn as_value(&self) -> u64
Returns the underlying raw value of the PointerOffset
Sourcepub fn set_segment_id(&mut self, value: SegmentId)
pub fn set_segment_id(&mut self, value: SegmentId)
Sets the SegmentId of the PointerOffset.
Sourcepub const fn segment_id(&self) -> SegmentId
pub const fn segment_id(&self) -> SegmentId
Returns the SegmentId.
Trait Implementations§
Source§impl Clone for PointerOffset
impl Clone for PointerOffset
Source§fn clone(&self) -> PointerOffset
fn clone(&self) -> PointerOffset
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 PointerOffset
impl Debug for PointerOffset
Source§impl PartialEq for PointerOffset
impl PartialEq for PointerOffset
Source§fn eq(&self, other: &PointerOffset) -> bool
fn eq(&self, other: &PointerOffset) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PointerOffset
impl Eq for PointerOffset
impl StructuralPartialEq for PointerOffset
Auto Trait Implementations§
impl Freeze for PointerOffset
impl RefUnwindSafe for PointerOffset
impl Send for PointerOffset
impl Sync for PointerOffset
impl Unpin for PointerOffset
impl UnsafeUnpin for PointerOffset
impl UnwindSafe for PointerOffset
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