pub struct RunId(/* private fields */);Expand description
Unique identifier for a pipeline run.
Format: YYYY-MM-DD_HH-mm-ss.SSSZ[-NN] where NN is an optional collision counter (01, 02, etc.)
The format is designed to be:
- Human-readable
- Machine-sortable (lexicographic sort == chronological order)
- Filesystem-safe (no colons, valid on macOS, Linux, Windows)
Implementations§
Source§impl RunId
impl RunId
Sourcepub fn new() -> Self
pub fn new() -> Self
Generate a new run ID based on current UTC timestamp.
Returns a RunId with format: YYYY-MM-DD_HH-mm-ss.SSSZ
Sourcepub fn for_test(id: &str) -> Self
pub fn for_test(id: &str) -> Self
Create a RunId from a string value (for testing).
This is a test-only constructor that allows creating a RunId with a fixed timestamp value for deterministic testing of collision handling.
§Warning
This is intended for testing only. Using a fixed run_id in production
could lead to directory collisions. Always use RunId::new
or RunId::from_checkpoint in production code.
Sourcepub fn from_checkpoint(id: &str) -> Self
pub fn from_checkpoint(id: &str) -> Self
Create a RunId from an existing string (for resume).
This is used when loading a checkpoint to continue using the same run_id from the previous session.
Sourcepub fn with_collision_counter(&self, counter: u32) -> Self
pub fn with_collision_counter(&self, counter: u32) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunId
impl<'de> Deserialize<'de> for RunId
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>,
impl Eq for RunId
impl StructuralPartialEq for RunId
Auto Trait Implementations§
impl Freeze for RunId
impl RefUnwindSafe for RunId
impl Send for RunId
impl Sync for RunId
impl Unpin for RunId
impl UnwindSafe for RunId
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,
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<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