Skip to main content

Keep

Struct Keep 

Source
pub struct Keep<'a> { /* private fields */ }
Expand description

A rebuild in progress, handed to the owner so it can move its references.

Implementations§

Source§

impl Keep<'_>

Source

pub fn moved(&mut self, at: &mut u32, len: usize)

Carry the len bytes at *at over, and point at at where they landed.

§Panics

If they are not inside the old blob, which is the mistake Blob::read catches and it is caught here for the same reason.

Source

pub fn moved_span(&mut self, span: &mut Span)

The same for a Span, whose length does not change.

Source

pub fn moved_sized(&mut self, at: &mut u32)

The same for a Blob::push_sized run, prefix and all.

The length is in the bytes being moved rather than in the reference, so it is read off the old copy, which is the whole reason Keep::peek is here.

Source

pub fn peek(&self, at: u32, len: usize) -> &[u8]

The len bytes at at, as they were before the rebuild started.

A reference whose length is written into the bytes rather than held beside them has to read those bytes to know how many to carry over, and the blob it would normally read from is half moved by the time it is asked. This is the old copy, which is still whole.

§Panics

If they are not inside the old blob.

Trait Implementations§

Source§

impl<'a> Debug for Keep<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Keep<'a>

§

impl<'a> RefUnwindSafe for Keep<'a>

§

impl<'a> Send for Keep<'a>

§

impl<'a> Sync for Keep<'a>

§

impl<'a> Unpin for Keep<'a>

§

impl<'a> UnsafeUnpin for Keep<'a>

§

impl<'a> UnwindSafe for Keep<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.