Struct possum::SnapshotValue

source ·
pub struct SnapshotValue<V> { /* private fields */ }

Implementations§

source§

impl<V> SnapshotValue<V>
where V: AsRef<Value>,

source

pub fn view<R>(&self, f: impl FnOnce(&[u8]) -> R) -> Result<R>

source

pub fn read(&self, buf: &mut [u8]) -> Result<usize>

source

pub fn new_reader(&self) -> impl Read + '_

source

pub fn leak_snapshot_dir(&self)

For testing: Leak a reference to the snapshot tempdir so it’s not cleaned up when all references are forgotten. This could possibly be used from internal tests instead.

Trait Implementations§

source§

impl<V: Debug> Debug for SnapshotValue<V>

source§

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

Formats the value using the given formatter. Read more
source§

impl<V> Deref for SnapshotValue<V>

§

type Target = V

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<V> ReadAt for SnapshotValue<V>
where V: AsRef<Value>,

source§

fn read_at(&self, pos: u64, buf: &mut [u8]) -> Result<usize>

Reads bytes from an offset in this source into a buffer, returning how many bytes were read. Read more
source§

fn read_exact_at(&self, pos: u64, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf from an offset. Read more

Auto Trait Implementations§

§

impl<V> RefUnwindSafe for SnapshotValue<V>
where V: RefUnwindSafe,

§

impl<V> Send for SnapshotValue<V>
where V: Send,

§

impl<V> Sync for SnapshotValue<V>
where V: Sync,

§

impl<V> Unpin for SnapshotValue<V>
where V: Unpin,

§

impl<V> UnwindSafe for SnapshotValue<V>
where V: UnwindSafe,

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<R> ReadBytesAtExt for R
where R: ReadAt,

source§

fn read_u8_at(&self, pos: u64) -> Result<u8, Error>

Reads an unsigned 8-bit integer at an offset.
source§

fn read_i8_at(&self, pos: u64) -> Result<i8, Error>

Reads a signed 8-bit integer at an offset.
source§

fn read_u16_at<T>(&self, pos: u64) -> Result<u16, Error>
where T: ByteOrder,

Reads an unsigned 16-bit integer at an offset.
source§

fn read_i16_at<T>(&self, pos: u64) -> Result<i16, Error>
where T: ByteOrder,

Reads a signed 16-bit integer at an offset.
source§

fn read_u32_at<T>(&self, pos: u64) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 32-bit integer at an offset.
source§

fn read_i32_at<T>(&self, pos: u64) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 32-bit integer at an offset.
source§

fn read_u64_at<T>(&self, pos: u64) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 64-bit integer at an offset.
source§

fn read_i64_at<T>(&self, pos: u64) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 64-bit integer at an offset.
source§

fn read_uint_at<T>(&self, pos: u64, nbytes: usize) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned nbytes-bit integer at an offset.
source§

fn read_int_at<T>(&self, pos: u64, nbytes: usize) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed nbytes-bit integer at an offset.
source§

fn read_f32_at<T>(&self, pos: u64) -> Result<f32, Error>
where T: ByteOrder,

Reads a single-precision floating point number at an offset.
source§

fn read_f64_at<T>(&self, pos: u64) -> Result<f64, Error>
where T: ByteOrder,

Reads a double-precision floating point number at an offset.
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V