pub struct SpoolId(/* private fields */);
Expand description
Identifies a message within the spool of its host node.
Implementations§
Source§impl SpoolId
impl SpoolId
pub fn new() -> Self
pub fn compute_path(&self, in_dir: &Path) -> PathBuf
pub fn as_bytes(&self) -> &[u8; 16]
pub fn from_slice(s: &[u8]) -> Option<Self>
pub fn from_ascii_bytes(s: &[u8]) -> Option<Self>
pub fn from_str(s: &str) -> Option<Self>
pub fn from_path(path: &Path) -> Option<Self>
Sourcepub fn age(&self, now: DateTime<Utc>) -> Duration
pub fn age(&self, now: DateTime<Utc>) -> Duration
Returns time elapsed since the id was created, given the current timestamp
pub fn created(&self) -> DateTime<Utc>
Sourcepub fn derive_new_with_cloned_timestamp(&self) -> Self
pub fn derive_new_with_cloned_timestamp(&self) -> Self
Assuming that self is a SpoolId received from some other node, this method produces a new SpoolId with the information from the local node, but with the timestamp from the source spool id. The intent is to reduces the chances of having multiple messages with the same spool id live on a system in the case of a misconfiguration that produces a loop.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SpoolId
impl<'de> Deserialize<'de> for SpoolId
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 Copy for SpoolId
impl Eq for SpoolId
impl StructuralPartialEq for SpoolId
Auto Trait Implementations§
impl Freeze for SpoolId
impl RefUnwindSafe for SpoolId
impl Send for SpoolId
impl Sync for SpoolId
impl Unpin for SpoolId
impl UnwindSafe for SpoolId
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more