pub struct StreamCursorRef {
pub position: ReplayCursor,
pub created_at: DateTime<Utc>,
pub metadata: Metadata,
}Expand description
Stable durable reference to a family-aware stream replay position.
Fields§
§position: ReplayCursorCanonical stream cursor. Family, scope, sequence, and backend position live here once.
created_at: DateTime<Utc>Creation time.
metadata: MetadataCursor metadata.
Implementations§
Source§impl StreamCursorRef
impl StreamCursorRef
Sourcepub fn new(position: ReplayCursor) -> Self
pub fn new(position: ReplayCursor) -> Self
Build a durable reference from a canonical cursor.
Sourcepub const fn family(&self) -> ReplayCursorFamily
pub const fn family(&self) -> ReplayCursorFamily
Return the cursor family.
Sourcepub const fn scope(&self) -> &ReplayScope
pub const fn scope(&self) -> &ReplayScope
Return the cursor scope.
Sourcepub fn same_stream(&self, other: &Self) -> bool
pub fn same_stream(&self, other: &Self) -> bool
Return whether two references address the same stream family and scope.
Sourcepub fn validate_for_run(
&self,
run_id: &RunId,
) -> Result<(), StreamCursorRefError>
pub fn validate_for_run( &self, run_id: &RunId, ) -> Result<(), StreamCursorRefError>
Validate that this cursor belongs to the supplied run scope.
§Errors
Returns an error when the cursor addresses another run or a non-run scope.
Sourcepub fn validate_progression(
&self,
current: &Self,
) -> Result<(), StreamCursorRefError>
pub fn validate_progression( &self, current: &Self, ) -> Result<(), StreamCursorRefError>
Validate that replacing an existing same-stream cursor does not regress.
§Errors
Returns an error when the proposed sequence is behind the current sequence.
Trait Implementations§
Source§impl Clone for StreamCursorRef
impl Clone for StreamCursorRef
Source§fn clone(&self) -> StreamCursorRef
fn clone(&self) -> StreamCursorRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamCursorRef
impl Debug for StreamCursorRef
Source§impl<'de> Deserialize<'de> for StreamCursorRef
impl<'de> Deserialize<'de> for StreamCursorRef
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 StreamCursorRef
Source§impl PartialEq for StreamCursorRef
impl PartialEq for StreamCursorRef
Source§impl Serialize for StreamCursorRef
impl Serialize for StreamCursorRef
impl StructuralPartialEq for StreamCursorRef
Auto Trait Implementations§
impl Freeze for StreamCursorRef
impl RefUnwindSafe for StreamCursorRef
impl Send for StreamCursorRef
impl Sync for StreamCursorRef
impl Unpin for StreamCursorRef
impl UnsafeUnpin for StreamCursorRef
impl UnwindSafe for StreamCursorRef
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