Trait cock_lib::FromString
source · pub trait FromString {
// Required method
fn from_string(string: &str) -> Self;
}Expand description
FromString is a trait for objects that can be constructed from a string. The FromString::from_string function takes a string reference as input and returns an instance of the type implementing this trait based on the string.
Required Methods§
sourcefn from_string(string: &str) -> Self
fn from_string(string: &str) -> Self
Function to create an instance of the type implementing this trait from a string.
Implementors§
impl FromString for Abnormalities
The FromString trait implementation for Abnormalities returns an Abnormalities variant based on the string provided.
impl FromString for Aesthetic
The FromString trait implementation for Aesthetic returns an Aesthetic variant based on the string provided.
impl FromString for Balls
The FromString trait implementation for Balls returns an Balls variant based on the string provided.
impl FromString for Circumcision
The FromString traits implementation for Circumcision returns a Circumcision variant.
impl FromString for Curvature
Implementation of the FromString trait for Curvature. This allows a Curvature instance to be created from a string value. The Curvature::Other variant involves a user prompt for a custom description.
impl FromString for ID
Implementing FromString for ID enum to create an ID instance from a string.
impl FromString for Shape
Implementation of the FromString trait for Shape. This allows a Shape instance to be created from a string value. The Shape::Other variant involves a user prompt for a custom shape description.
impl FromString for SizeType
The FromString trait implementation for SizeType returns a SizeType variant based on the string provided.
impl FromString for Tier
The FromString trait implementation for Tier returns a variant of Tier.
impl FromString for Veininess
Implementing FromString for Veininess enum to create a Veininess instance from a string.