pub struct ResumptionManager { /* private fields */ }Expand description
Manager for handling connection resumption.
Implementations§
Source§impl ResumptionManager
impl ResumptionManager
Sourcepub fn new(event_store: Arc<dyn EventStore>, session_id: String) -> Self
pub fn new(event_store: Arc<dyn EventStore>, session_id: String) -> Self
Create a new resumption manager.
Sourcepub async fn record_outbound(&self, message: TransportMessage) -> Result<()>
pub async fn record_outbound(&self, message: TransportMessage) -> Result<()>
Record an outbound message.
Sourcepub async fn record_inbound(&self, message: TransportMessage) -> Result<()>
pub async fn record_inbound(&self, message: TransportMessage) -> Result<()>
Record an inbound message.
Sourcepub async fn create_token(&self) -> Result<ResumptionToken>
pub async fn create_token(&self) -> Result<ResumptionToken>
Create a resumption token for the current state.
Sourcepub async fn resume_from_token(&self, token: &str) -> Result<Vec<StoredEvent>>
pub async fn resume_from_token(&self, token: &str) -> Result<Vec<StoredEvent>>
Resume from a token, returning events since last acknowledgement.
Sourcepub async fn get_pending_events(
&self,
since_event_id: &str,
) -> Result<Vec<StoredEvent>>
pub async fn get_pending_events( &self, since_event_id: &str, ) -> Result<Vec<StoredEvent>>
Get pending events that need to be resent.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ResumptionManager
impl !UnwindSafe for ResumptionManager
impl Freeze for ResumptionManager
impl Send for ResumptionManager
impl Sync for ResumptionManager
impl Unpin for ResumptionManager
impl UnsafeUnpin for ResumptionManager
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