Skip to main content

StreamFixtureSource

Struct StreamFixtureSource 

Source
pub struct StreamFixtureSource<'fixture> { /* private fields */ }
Expand description

Borrowed ordered chunks for one deterministic finite source.

Implementations§

Source§

impl<'fixture> StreamFixtureSource<'fixture>

Source

pub const fn new( chunks: &'fixture [&'fixture [u8]], ) -> Result<Self, StreamFixtureError>

Creates one bounded source. Empty borrowed slices represent explicit empty chunks rather than end-of-stream.

Source

pub const fn with_replayability( chunks: &'fixture [&'fixture [u8]], replayability: StreamReplayability<'fixture>, ) -> Result<Self, StreamFixtureError>

Creates a bounded source with an explicit replay capability.

Source

pub const fn with_fault_at_observation( self, observation: usize, ) -> Result<Self, StreamFixtureError>

Injects a source failure at one one-based read observation.

Source

pub const fn observations(&self) -> usize

Returns source observations including the final end marker.

Trait Implementations§

Source§

impl AsyncStreamSource for StreamFixtureSource<'_>

Source§

type Error = StreamFixtureError

Source-specific payload-free failure.
Source§

fn replayability(&self) -> StreamReplayability<'_>

Returns explicit body replayability and exact source version.
Source§

async fn read_chunk<'operation>( &'operation mut self, output: &'operation mut [u8], ) -> Result<StreamRead, Self::Error>

Produces at most one chunk in a Send future.
Source§

impl BlockingStreamSource for StreamFixtureSource<'_>

Source§

type Error = StreamFixtureError

Source-specific payload-free failure.
Source§

fn replayability(&self) -> StreamReplayability<'_>

Returns explicit body replayability and exact source version.
Source§

fn read_chunk(&mut self, output: &mut [u8]) -> Result<StreamRead, Self::Error>

Produces at most one chunk and never retains output.

Auto Trait Implementations§

§

impl<'fixture> Freeze for StreamFixtureSource<'fixture>

§

impl<'fixture> RefUnwindSafe for StreamFixtureSource<'fixture>

§

impl<'fixture> Send for StreamFixtureSource<'fixture>

§

impl<'fixture> Sync for StreamFixtureSource<'fixture>

§

impl<'fixture> Unpin for StreamFixtureSource<'fixture>

§

impl<'fixture> UnsafeUnpin for StreamFixtureSource<'fixture>

§

impl<'fixture> UnwindSafe for StreamFixtureSource<'fixture>

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

Source§

type Error = <T as AsyncStreamSource>::Error

Source-specific payload-free failure.
Source§

fn replayability(&self) -> StreamReplayability<'_>

Returns explicit body replayability and exact source version.
Source§

async fn read_chunk_local<'operation>( &'operation mut self, output: &'operation mut [u8], ) -> Result<StreamRead, <T as LocalAsyncStreamSource>::Error>

Produces at most one chunk without retaining output after completion.
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.