Skip to main content

Slice

Struct Slice 

Source
pub struct Slice<'a, D, G> { /* private fields */ }
Expand description

A borrowed resident source using the same original-range contract.

Implementations§

Source§

impl<'a, D, G> Slice<'a, D, G>

Source

pub fn new(bytes: &'a [u8], snapshot: Snapshot<D, G>) -> Slice<'a, D, G>

Binds original bytes to their caller-owned source identity.

Trait Implementations§

Source§

impl<D, G> RangeSource for Slice<'_, D, G>
where D: Copy + Eq, G: Copy + Eq,

Source§

type Document = D

Stable, constant-time comparable source-owner identity.
Source§

type Generation = G

Constant-time comparable immutable generation.
Source§

type Error = !

Original acquisition failure.
Source§

fn stamp(&self) -> Stamp<D, G>

Constant-time metadata, without allocation, traversal or I/O.
Source§

fn read_at<'q, W>( &'q self, offset: u64, output: &'q mut [u8], _work: &'q W, ) -> impl Future<Output = Result<usize, ReadError<<Slice<'_, D, G> as RangeSource>::Error>>> + 'q
where W: Work + 'q,

Fills a bounded original range; no executor, Send or heap future bound.

Auto Trait Implementations§

§

impl<'a, D, G> Freeze for Slice<'a, D, G>
where Stamp<D, G>: Freeze,

§

impl<'a, D, G> RefUnwindSafe for Slice<'a, D, G>
where Stamp<D, G>: RefUnwindSafe,

§

impl<'a, D, G> Send for Slice<'a, D, G>
where Stamp<D, G>: Send,

§

impl<'a, D, G> Sync for Slice<'a, D, G>
where Stamp<D, G>: Sync,

§

impl<'a, D, G> Unpin for Slice<'a, D, G>
where Stamp<D, G>: Unpin,

§

impl<'a, D, G> UnsafeUnpin for Slice<'a, D, G>
where Stamp<D, G>: UnsafeUnpin,

§

impl<'a, D, G> UnwindSafe for Slice<'a, D, G>
where Stamp<D, G>: 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<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.