Struct 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>

Source§

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> Freeze for SnapshotValue<V>
where V: Freeze,

§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more