pub struct FormationId(/* private fields */);Expand description
The id of the formation a session belongs to, matching ^frm_[0-9a-f]{32}$.
Implementations§
Source§impl FormationId
impl FormationId
Sourcepub fn mint() -> Self
pub fn mint() -> Self
A fresh formation id, for a launcher starting a formation’s members.
Two launches of the same formation get two different ids.
Sourcepub fn parse(value: &str) -> Result<Self, RuntimeError>
pub fn parse(value: &str) -> Result<Self, RuntimeError>
Accept value only if it is exactly a formation id; nothing is trimmed.
The error’s reason names what is wrong with the value and never contains it.
Sourcepub fn from_env() -> Result<Option<Self>, RuntimeError>
pub fn from_env() -> Result<Option<Self>, RuntimeError>
This session’s formation, read from FORMATION_ID_ENV in the process environment.
Ok(None) for a session nobody placed in a formation — the variable absent, or blank —
which is the ordinary case. Any other value that is not a formation id is an error and not
an absence: a session that cannot tell which formation it belongs to would be grouped with
the wrong one, or with none.
pub fn as_str(&self) -> &str
Sourcepub fn minted_at_ms(&self) -> u64
pub fn minted_at_ms(&self) -> u64
When this id was minted, in milliseconds since the Unix epoch: the first 12 hex digits of
its UUIDv7, read the same way retention::session_id_timestamp_ms reads a ses_ id.
A member’s session is minted after the formation it joins, so a reader looking for members can pass over every session older than this.
Trait Implementations§
Source§impl Clone for FormationId
impl Clone for FormationId
Source§impl Debug for FormationId
impl Debug for FormationId
Source§impl<'de> Deserialize<'de> for FormationId
Only through FormationId::parse, so a file carrying anything but a formation id does not
deserialize at all. The error names what is wrong and never contains the value.
impl<'de> Deserialize<'de> for FormationId
Only through FormationId::parse, so a file carrying anything but a formation id does not
deserialize at all. The error names what is wrong and never contains the value.
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for FormationId
impl Display for FormationId
impl Eq for FormationId
Source§impl Hash for FormationId
impl Hash for FormationId
Source§impl PartialEq for FormationId
impl PartialEq for FormationId
Source§impl Serialize for FormationId
A bare string, "frm_…".
impl Serialize for FormationId
A bare string, "frm_…".
impl StructuralPartialEq for FormationId
Auto Trait Implementations§
impl Forget for FormationId
impl Freeze for FormationId
impl Move for FormationId
impl RefUnwindSafe for FormationId
impl Send for FormationId
impl Sync for FormationId
impl Unpin for FormationId
impl UnsafeUnpin for FormationId
impl UnwindSafe for FormationId
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
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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