pub struct RecordSource { /* private fields */ }Expand description
Adapts any DatasetReader into a Source the generic engine can collect.
Implementations§
Source§impl RecordSource
impl RecordSource
Sourcepub fn new(name: impl Into<String>, reader: Box<dyn DatasetReader>) -> Self
pub fn new(name: impl Into<String>, reader: Box<dyn DatasetReader>) -> Self
Create a record source with a stable name over the given reader.
Sourcepub fn with_cache_key(self, cache_key: Value) -> Self
pub fn with_cache_key(self, cache_key: Value) -> Self
Override the cache key describing this source’s configured inputs.
Sourcepub fn with_max_items(self, max_items: usize) -> Self
pub fn with_max_items(self, max_items: usize) -> Self
Declare the maximum number of records this source will emit.
Trait Implementations§
Source§impl Source<DatasetRecord> for RecordSource
impl Source<DatasetRecord> for RecordSource
Source§fn stream(
self: Box<Self>,
_cancel: CancellationToken,
) -> BoxItemStream<DatasetRecord>
fn stream( self: Box<Self>, _cancel: CancellationToken, ) -> BoxItemStream<DatasetRecord>
Stream items from this source.
Source§fn display_name(&self) -> &str
fn display_name(&self) -> &str
Human-readable source label.
Source§fn set_resume_state(&mut self, _offset: usize, _already_fetched: usize)
fn set_resume_state(&mut self, _offset: usize, _already_fetched: usize)
Configure resume state before streaming.
Auto Trait Implementations§
impl !RefUnwindSafe for RecordSource
impl !UnwindSafe for RecordSource
impl Freeze for RecordSource
impl Send for RecordSource
impl Sync for RecordSource
impl Unpin for RecordSource
impl UnsafeUnpin for RecordSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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