Skip to main content

SegmentedSource

Struct SegmentedSource 

Source
pub struct SegmentedSource<'segments, 'bytes> { /* private fields */ }
Expand description

Borrowed segmented source used by unit tests, fuzz targets, and simple transport adapters.

Implementations§

Source§

impl<'segments, 'bytes> SegmentedSource<'segments, 'bytes>

Source

pub fn new( segments: &'segments [&'bytes [u8]], ) -> Result<Self, SegmentedRegionError>

Trait Implementations§

Source§

impl ByteSource for SegmentedSource<'_, '_>

Source§

fn len(&self) -> u64

Stable logical length of this source.
Source§

fn read_at(&self, offset: u64, target: &mut [u8]) -> Result<(), BackendError>

Fill target from the exact logical range beginning at offset.
Source§

fn as_contiguous(&self) -> Option<&[u8]>

Borrow the complete logical source when it is one contiguous region. Read more
Source§

fn is_empty(&self) -> bool

Source§

impl<'segments, 'bytes> Debug for SegmentedSource<'segments, 'bytes>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'segments, 'bytes> Freeze for SegmentedSource<'segments, 'bytes>

§

impl<'segments, 'bytes> RefUnwindSafe for SegmentedSource<'segments, 'bytes>

§

impl<'segments, 'bytes> Send for SegmentedSource<'segments, 'bytes>

§

impl<'segments, 'bytes> Sync for SegmentedSource<'segments, 'bytes>

§

impl<'segments, 'bytes> Unpin for SegmentedSource<'segments, 'bytes>

§

impl<'segments, 'bytes> UnsafeUnpin for SegmentedSource<'segments, 'bytes>

§

impl<'segments, 'bytes> UnwindSafe for SegmentedSource<'segments, 'bytes>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.