pub struct MlFeatureName(/* private fields */);Implementations§
Source§impl MlFeatureName
impl MlFeatureName
Sourcepub fn new(value: impl AsRef<str>) -> Result<MlFeatureName, MlFeatureError>
pub fn new(value: impl AsRef<str>) -> Result<MlFeatureName, MlFeatureError>
Examples found in repository?
examples/basic_usage.rs (line 5)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let dataset = MlDatasetName::new("iris")?;
5 let feature = MlFeatureName::new("sepal_width")?;
6 let model = MlModelName::new("baseline-classifier")?;
7 let shape = TensorShape::new([150, 4])?;
8
9 assert_eq!(dataset.as_str(), "iris");
10 assert_eq!(feature.as_str(), "sepal_width");
11 assert_eq!(model.as_str(), "baseline-classifier");
12 assert_eq!(shape.dims(), &[150, 4]);
13 Ok(())
14}Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Examples found in repository?
examples/basic_usage.rs (line 10)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let dataset = MlDatasetName::new("iris")?;
5 let feature = MlFeatureName::new("sepal_width")?;
6 let model = MlModelName::new("baseline-classifier")?;
7 let shape = TensorShape::new([150, 4])?;
8
9 assert_eq!(dataset.as_str(), "iris");
10 assert_eq!(feature.as_str(), "sepal_width");
11 assert_eq!(model.as_str(), "baseline-classifier");
12 assert_eq!(shape.dims(), &[150, 4]);
13 Ok(())
14}Trait Implementations§
Source§impl AsRef<str> for MlFeatureName
impl AsRef<str> for MlFeatureName
Source§impl Clone for MlFeatureName
impl Clone for MlFeatureName
Source§fn clone(&self) -> MlFeatureName
fn clone(&self) -> MlFeatureName
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 MlFeatureName
impl Debug for MlFeatureName
Source§impl Display for MlFeatureName
impl Display for MlFeatureName
Source§impl FromStr for MlFeatureName
impl FromStr for MlFeatureName
Source§type Err = MlFeatureError
type Err = MlFeatureError
The associated error which can be returned from parsing.
Source§fn from_str(
value: &str,
) -> Result<MlFeatureName, <MlFeatureName as FromStr>::Err>
fn from_str( value: &str, ) -> Result<MlFeatureName, <MlFeatureName as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for MlFeatureName
impl Hash for MlFeatureName
Source§impl Ord for MlFeatureName
impl Ord for MlFeatureName
Source§fn cmp(&self, other: &MlFeatureName) -> Ordering
fn cmp(&self, other: &MlFeatureName) -> 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 MlFeatureName
impl PartialEq for MlFeatureName
Source§fn eq(&self, other: &MlFeatureName) -> bool
fn eq(&self, other: &MlFeatureName) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MlFeatureName
impl PartialOrd for MlFeatureName
Source§impl TryFrom<&str> for MlFeatureName
impl TryFrom<&str> for MlFeatureName
Source§type Error = MlFeatureError
type Error = MlFeatureError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<MlFeatureName, <MlFeatureName as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<MlFeatureName, <MlFeatureName as TryFrom<&str>>::Error>
Performs the conversion.
impl Eq for MlFeatureName
impl StructuralPartialEq for MlFeatureName
Auto Trait Implementations§
impl Freeze for MlFeatureName
impl RefUnwindSafe for MlFeatureName
impl Send for MlFeatureName
impl Sync for MlFeatureName
impl Unpin for MlFeatureName
impl UnsafeUnpin for MlFeatureName
impl UnwindSafe for MlFeatureName
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