pub struct BackendBuilder<Args, DB, Fetch, Sink, IdType, Config = ()> { /* private fields */ }Expand description
Builder for CustomBackend
Lets you set the database, fetcher, sink, codec, and config
Implementations§
Source§impl<Args, DB, Fetch, Sink, IdType> BackendBuilder<Args, DB, Fetch, Sink, IdType, ()>
impl<Args, DB, Fetch, Sink, IdType> BackendBuilder<Args, DB, Fetch, Sink, IdType, ()>
Sourcepub fn new_with_cfg<Config>(
config: Config,
) -> BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
pub fn new_with_cfg<Config>( config: Config, ) -> BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
Create a new BackendBuilder instance with custom configuration
Source§impl<Args, DB, Fetch, Sink, IdType, Config> BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config> BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
Sourcepub fn fetcher<F: Fn(&mut DB, &Config, &WorkerContext) -> Fetch + Send + Sync + 'static>(
self,
fetcher: F,
) -> Self
pub fn fetcher<F: Fn(&mut DB, &Config, &WorkerContext) -> Fetch + Send + Sync + 'static>( self, fetcher: F, ) -> Self
The fetcher function to retrieve tasks from the database
Sourcepub fn sink<F: Fn(&mut DB, &Config) -> Sink + Send + Sync + 'static>(
self,
sink: F,
) -> Self
pub fn sink<F: Fn(&mut DB, &Config) -> Sink + Send + Sync + 'static>( self, sink: F, ) -> Self
The sink function to persist tasks to the database
Sourcepub fn build(
self,
) -> Result<CustomBackend<Args, DB, Fetch, Sink, IdType, Config>, BuildError>
pub fn build( self, ) -> Result<CustomBackend<Args, DB, Fetch, Sink, IdType, Config>, BuildError>
Build the CustomBackend instance
Trait Implementations§
Source§impl<Args, DB, Fetch, Sink, IdType, Config> Debug for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config> Debug for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
Auto Trait Implementations§
impl<Args, DB, Fetch, Sink, IdType, Config> Freeze for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config = ()> !RefUnwindSafe for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config> Send for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config> Sync for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config> Unpin for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
impl<Args, DB, Fetch, Sink, IdType, Config = ()> !UnwindSafe for BackendBuilder<Args, DB, Fetch, Sink, IdType, Config>
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