pub struct MlTrainingRunId(/* private fields */);Implementations§
Source§impl MlTrainingRunId
impl MlTrainingRunId
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, MlTrainingError>
pub fn new(value: impl AsRef<str>) -> Result<Self, MlTrainingError>
Examples found in repository?
examples/basic_usage.rs (line 4)
3fn main() -> Result<(), use_ml_training::MlTrainingError> {
4 let run_id = MlTrainingRunId::new("run-001")?;
5 let batch_size = MlBatchSize::new(32)?;
6 let learning_rate = MlLearningRate::new(0.001)?;
7 let optimizer: MlOptimizerKind = "adamw".parse()?;
8
9 assert_eq!(run_id.as_str(), "run-001");
10 assert_eq!(batch_size.get(), 32);
11 assert_eq!(learning_rate.value(), 0.001);
12 assert_eq!(optimizer, MlOptimizerKind::AdamW);
13 Ok(())
14}Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Examples found in repository?
examples/basic_usage.rs (line 9)
3fn main() -> Result<(), use_ml_training::MlTrainingError> {
4 let run_id = MlTrainingRunId::new("run-001")?;
5 let batch_size = MlBatchSize::new(32)?;
6 let learning_rate = MlLearningRate::new(0.001)?;
7 let optimizer: MlOptimizerKind = "adamw".parse()?;
8
9 assert_eq!(run_id.as_str(), "run-001");
10 assert_eq!(batch_size.get(), 32);
11 assert_eq!(learning_rate.value(), 0.001);
12 assert_eq!(optimizer, MlOptimizerKind::AdamW);
13 Ok(())
14}Trait Implementations§
Source§impl AsRef<str> for MlTrainingRunId
impl AsRef<str> for MlTrainingRunId
Source§impl Clone for MlTrainingRunId
impl Clone for MlTrainingRunId
Source§fn clone(&self) -> MlTrainingRunId
fn clone(&self) -> MlTrainingRunId
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 MlTrainingRunId
impl Debug for MlTrainingRunId
Source§impl Display for MlTrainingRunId
impl Display for MlTrainingRunId
Source§impl FromStr for MlTrainingRunId
impl FromStr for MlTrainingRunId
Source§impl Hash for MlTrainingRunId
impl Hash for MlTrainingRunId
Source§impl Ord for MlTrainingRunId
impl Ord for MlTrainingRunId
Source§fn cmp(&self, other: &MlTrainingRunId) -> Ordering
fn cmp(&self, other: &MlTrainingRunId) -> 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 MlTrainingRunId
impl PartialEq for MlTrainingRunId
Source§fn eq(&self, other: &MlTrainingRunId) -> bool
fn eq(&self, other: &MlTrainingRunId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MlTrainingRunId
impl PartialOrd for MlTrainingRunId
Source§impl TryFrom<&str> for MlTrainingRunId
impl TryFrom<&str> for MlTrainingRunId
impl Eq for MlTrainingRunId
impl StructuralPartialEq for MlTrainingRunId
Auto Trait Implementations§
impl Freeze for MlTrainingRunId
impl RefUnwindSafe for MlTrainingRunId
impl Send for MlTrainingRunId
impl Sync for MlTrainingRunId
impl Unpin for MlTrainingRunId
impl UnsafeUnpin for MlTrainingRunId
impl UnwindSafe for MlTrainingRunId
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