pub struct PosMapping { /* private fields */ }Expand description
Mapping from input address (i.e. memory address of value being serialized) to output position (i.e. position of that value’s representation in serializer’s output).
Used by CompleteSerializer and PtrOffsetSerializer for tracking
where pointers are in output.
Implementations§
Source§impl PosMapping
impl PosMapping
Sourcepub fn pos_for_addr(&self, addr: usize) -> usize
pub fn pos_for_addr(&self, addr: usize) -> usize
Get position in output for a value which has been serialized.
That value must have been serialized in an allocation which this
PosMapping represents the start of.
Sourcepub fn pos_for<T>(&self, value: &T) -> usize
pub fn pos_for<T>(&self, value: &T) -> usize
Get position in output for a value which has been serialized.
That value must have been serialized in an allocation which this
PosMapping represents the start of.
Trait Implementations§
Source§impl Clone for PosMapping
impl Clone for PosMapping
Source§fn clone(&self) -> PosMapping
fn clone(&self) -> PosMapping
Returns a duplicate of the value. Read more
1.0.0 · 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 PosMapping
impl Debug for PosMapping
impl Copy for PosMapping
Auto Trait Implementations§
impl Freeze for PosMapping
impl RefUnwindSafe for PosMapping
impl Send for PosMapping
impl Sync for PosMapping
impl Unpin for PosMapping
impl UnwindSafe for PosMapping
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