pub struct DataLoaderBuilder<S: DataSource> { /* private fields */ }Expand description
Builder for DataLoader.
§Example
ⓘ
let loader = DataLoader::<TradingViewSource>::builder()
.source(tv_source)
.sink(channel_sink)
.channel_capacity(8192)
.build()?;Implementations§
Source§impl<S: DataSource> DataLoaderBuilder<S>
impl<S: DataSource> DataLoaderBuilder<S>
Sourcepub fn sink(self, sink: impl EventSink) -> Self
pub fn sink(self, sink: impl EventSink) -> Self
Register an event sink. You can call this multiple times to fan out to several sinks.
Sourcepub fn channel_capacity(self, capacity: usize) -> Self
pub fn channel_capacity(self, capacity: usize) -> Self
Override the default channel capacity (4096).
Sourcepub fn continue_on_sink_error(self, val: bool) -> Self
pub fn continue_on_sink_error(self, val: bool) -> Self
If true, the loader keeps running even when a sink rejects events.
Sourcepub fn build(self) -> Result<DataLoader<S>>
pub fn build(self) -> Result<DataLoader<S>>
Trait Implementations§
Source§impl<S: DataSource> Default for DataLoaderBuilder<S>
impl<S: DataSource> Default for DataLoaderBuilder<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for DataLoaderBuilder<S>
impl<S> !UnwindSafe for DataLoaderBuilder<S>
impl<S> Freeze for DataLoaderBuilder<S>where
S: Freeze,
impl<S> Send for DataLoaderBuilder<S>
impl<S> Sync for DataLoaderBuilder<S>
impl<S> Unpin for DataLoaderBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for DataLoaderBuilder<S>where
S: 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