pub struct ExecutionId(/* private fields */);Expand description
The identity of one execution: x-<UTC timestamp>-<8 hex>.
The shape is the layer’s own — a task is t-20260905034523-a9f1 — so that an id read
in a log, a URL or a browser tab is recognisable as this repository’s without a
dependency on a UUID crate. The timestamp orders ids by creation for a reader; the
suffix, not the timestamp, is what makes two ids created in the same second differ.
Implementations§
Source§impl ExecutionId
impl ExecutionId
Sourcepub fn fresh() -> Self
pub fn fresh() -> Self
A fresh id for now.
use majordomus_cli::execution::ExecutionId;
let a = ExecutionId::fresh();
let b = ExecutionId::fresh();
assert_ne!(a, b, "two ids from the same second still differ");
assert!(ExecutionId::parse(a.as_str()).is_some());Sourcepub fn parse(text: &str) -> Option<Self>
pub fn parse(text: &str) -> Option<Self>
Parse an id a client sent. None when it is not one this executable would mint,
which is what keeps a path, a traversal or a wildcard out of a store lookup.
use majordomus_cli::execution::ExecutionId;
assert!(ExecutionId::parse("x-20260908T010203Z-0a1b2c3d").is_some());
assert!(ExecutionId::parse("../../etc/passwd").is_none());
assert!(ExecutionId::parse("x-20260908T010203Z-0a1b2c3").is_none(), "eight hex digits");Trait Implementations§
Source§impl Clone for ExecutionId
impl Clone for ExecutionId
Source§fn clone(&self) -> ExecutionId
fn clone(&self) -> ExecutionId
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 ExecutionId
impl Debug for ExecutionId
Source§impl<'de> Deserialize<'de> for ExecutionId
impl<'de> Deserialize<'de> for ExecutionId
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
Source§impl Display for ExecutionId
impl Display for ExecutionId
impl Eq for ExecutionId
Source§impl Hash for ExecutionId
impl Hash for ExecutionId
Source§impl JsonSchema for ExecutionId
impl JsonSchema for ExecutionId
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for ExecutionId
impl Ord for ExecutionId
Source§fn cmp(&self, other: &ExecutionId) -> Ordering
fn cmp(&self, other: &ExecutionId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ExecutionId
impl PartialEq for ExecutionId
Source§fn eq(&self, other: &ExecutionId) -> bool
fn eq(&self, other: &ExecutionId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ExecutionId
impl PartialOrd for ExecutionId
Source§impl Serialize for ExecutionId
impl Serialize for ExecutionId
impl StructuralPartialEq for ExecutionId
Auto Trait Implementations§
impl Freeze for ExecutionId
impl RefUnwindSafe for ExecutionId
impl Send for ExecutionId
impl Sync for ExecutionId
impl Unpin for ExecutionId
impl UnsafeUnpin for ExecutionId
impl UnwindSafe for ExecutionId
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.