Struct actyxos_sdk::Offset [−][src]
pub struct Offset(_);
Expand description
Event offset within a SourceId
’s stream
The event offset is not a number, it rather is an identifier that can be compared
to other identifiers. There are 2^63 such values. The incr
and decr
functions
find the successor or predecessor, respectively. incr
does not return an option
because for the use-case of naming events within a stream it is impossible to exhaust
the available set of values.
Implementations
Maximum possible offset
the max Offset needs to fit into an i64 and also needs to be losslessly converted into an f64 due to interop with braindead languages that do not have proper integers.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
This function shall only be used from tests to manufacture events where needed.
It is intentionally hard to extract the wrapped number from this type because offsets do not support useful arithmetic operations.
Fallible conversion from OffsetOrMin
This returns None
when presented with OffsetOrMin::MIN
.
Return the predecessor to this offset, possibly OffsetOrMin::MIN
Trait Implementations
Write any additional information about &self
beyond its binary representation. Read more
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
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Offset
impl UnwindSafe for Offset
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Performs the conversion.
Performs the conversion.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more