pub struct StreamBookmark {
pub stream_arn: Option<String>,
pub shards: BTreeMap<String, String>,
pub finished: BTreeSet<String>,
pub verified_at: BTreeMap<String, i64>,
}Expand description
Streams bookmark.
Fields§
§stream_arn: Option<String>Stream the positions belong to.
shards: BTreeMap<String, String>Shard id → last emitted sequence number ("" = opened, nothing read).
finished: BTreeSet<String>Closed shards fully drained.
verified_at: BTreeMap<String, i64>Empty-position shard → unix seconds it was last known to hold nothing unread.
Implementations§
Source§impl StreamBookmark
impl StreamBookmark
Sourcepub fn from_value(v: &Value) -> Self
pub fn from_value(v: &Value) -> Self
Parse; malformed values are treated as absent.
Sourcepub fn parse(v: &Value) -> Result<Self, FaucetError>
pub fn parse(v: &Value) -> Result<Self, FaucetError>
Parse a stored bookmark; null is absent, anything unparseable is an
error so a stream never silently restarts at start_position. A field
a streams bookmark never carries (a scan bookmark’s segments, say) is
refused too: every known field is optional, so such an object would
otherwise read as an empty bookmark.
Sourcepub fn open(&mut self, shard: &str)
pub fn open(&mut self, shard: &str)
Record that a shard was opened (keeps an existing position).
Sourcepub fn verify_empty(&mut self, shard: &str, now: i64)
pub fn verify_empty(&mut self, shard: &str, now: i64)
An empty-position shard was read to its end: nothing retained is unread.
Trait Implementations§
Source§impl Clone for StreamBookmark
impl Clone for StreamBookmark
Source§impl Debug for StreamBookmark
impl Debug for StreamBookmark
Source§impl Default for StreamBookmark
impl Default for StreamBookmark
Source§impl<'de> Deserialize<'de> for StreamBookmark
impl<'de> Deserialize<'de> for StreamBookmark
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for StreamBookmark
Source§impl PartialEq for StreamBookmark
impl PartialEq for StreamBookmark
Source§impl Serialize for StreamBookmark
impl Serialize for StreamBookmark
impl StructuralPartialEq for StreamBookmark
Auto Trait Implementations§
impl Forget for StreamBookmark
impl Freeze for StreamBookmark
impl Move for StreamBookmark
impl RefUnwindSafe for StreamBookmark
impl Send for StreamBookmark
impl Sync for StreamBookmark
impl Unpin for StreamBookmark
impl UnsafeUnpin for StreamBookmark
impl UnwindSafe for StreamBookmark
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.