pub struct BoxedReader<I>(/* private fields */);Expand description
A reader of any concrete type, behind one dynamic dispatch.
Constructing one is the explicit, greppable point where the pipeline stops being monomorphized and starts paying a boxed future per call.
Implementations§
Source§impl<I> BoxedReader<I>
impl<I> BoxedReader<I>
Sourcepub fn new<R: ItemReader<I> + 'static>(reader: R) -> Self
pub fn new<R: ItemReader<I> + 'static>(reader: R) -> Self
Erases a concrete reader.
Trait Implementations§
Source§impl<I> ItemReader<I> for BoxedReader<I>
impl<I> ItemReader<I> for BoxedReader<I>
Source§fn read<'a>(
&'a mut self,
context: ReadContext<'a>,
) -> impl Future<Output = Result<ReadOutcome<I>, ReaderError>> + Send + 'a
fn read<'a>( &'a mut self, context: ReadContext<'a>, ) -> impl Future<Output = Result<ReadOutcome<I>, ReaderError>> + Send + 'a
Reads at most one item while borrowing the reader and call scope.
Auto Trait Implementations§
impl<I> !RefUnwindSafe for BoxedReader<I>
impl<I> !Sync for BoxedReader<I>
impl<I> !UnwindSafe for BoxedReader<I>
impl<I> Freeze for BoxedReader<I>
impl<I> Send for BoxedReader<I>
impl<I> Unpin for BoxedReader<I>
impl<I> UnsafeUnpin for BoxedReader<I>where
Box<dyn ReaderObject<I>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more