pub struct KeyObservation {
pub key: Vec<u8>,
/* private fields */
}
Expand description
A struct to manage receiving notifications for a key
Fields§
§key: Vec<u8>
The name of the key (for convenience)
Implementations§
Source§impl KeyObservation
impl KeyObservation
Sourcepub async fn recv_notification(
&mut self,
) -> Option<(KeyNotification, Option<AckToken>)>
pub async fn recv_notification( &mut self, ) -> Option<(KeyNotification, Option<AckToken>)>
Receives a state_store::KeyNotification
or None
if there will be no more notifications.
If there are notifications:
- Returns Some(
state_store::KeyNotification
,Option<AckToken>
) on success- If auto ack is disabled, the
AckToken
should be used or dropped when you want the ack to occur. If auto ack is enabled, you may use (state_store::KeyNotification
, _) to ignore theAckToken
.
- If auto ack is disabled, the
A received notification can be acknowledged via the AckToken
by calling AckToken::ack
or dropping the AckToken
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyObservation
impl RefUnwindSafe for KeyObservation
impl Send for KeyObservation
impl Sync for KeyObservation
impl Unpin for KeyObservation
impl UnwindSafe for KeyObservation
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