pub struct ApplicationBootstrapProvider { /* private fields */ }Expand description
Bootstrap provider for application sources that replays stored insert events
Implementations§
Source§impl ApplicationBootstrapProvider
impl ApplicationBootstrapProvider
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new provider with its own isolated bootstrap data storage Note: This creates an independent storage that won’t be connected to any ApplicationSource
Create a new provider with a shared reference to ApplicationSource’s bootstrap data This allows the provider to access the actual data stored by ApplicationSource
Sourcepub fn builder() -> ApplicationBootstrapProviderBuilder
pub fn builder() -> ApplicationBootstrapProviderBuilder
Create a builder for ApplicationBootstrapProvider
Source§impl ApplicationBootstrapProvider
impl ApplicationBootstrapProvider
Sourcepub async fn store_insert_event(&self, change: SourceChange)
pub async fn store_insert_event(&self, change: SourceChange)
Store an insert event for future bootstrap replay This would be called by the application source when it receives insert events
Sourcepub async fn get_stored_events(&self) -> Vec<SourceChange>
pub async fn get_stored_events(&self) -> Vec<SourceChange>
Get all stored insert events (for testing or inspection)
Sourcepub async fn clear_stored_events(&self)
pub async fn clear_stored_events(&self)
Clear stored events (for testing or reset)
Trait Implementations§
Source§impl BootstrapProvider for ApplicationBootstrapProvider
impl BootstrapProvider for ApplicationBootstrapProvider
Source§fn bootstrap<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: BootstrapRequest,
_context: &'life1 BootstrapContext,
_event_tx: BootstrapEventSender,
_settings: Option<&'life2 SourceSubscriptionSettings>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn bootstrap<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: BootstrapRequest,
_context: &'life1 BootstrapContext,
_event_tx: BootstrapEventSender,
_settings: Option<&'life2 SourceSubscriptionSettings>,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Perform bootstrap operation for the given request
Sends bootstrap events to the provided channel
Returns the number of elements sent Read more
Auto Trait Implementations§
impl Freeze for ApplicationBootstrapProvider
impl !RefUnwindSafe for ApplicationBootstrapProvider
impl Send for ApplicationBootstrapProvider
impl Sync for ApplicationBootstrapProvider
impl Unpin for ApplicationBootstrapProvider
impl UnsafeUnpin for ApplicationBootstrapProvider
impl !UnwindSafe for ApplicationBootstrapProvider
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