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§

source

fn from_string(string: &str) -> Self

Function to create an instance of the type implementing this trait from a string.

Implementors§

source§

impl FromString for Abnormalities

The FromString trait implementation for Abnormalities returns an Abnormalities variant based on the string provided.

source§

impl FromString for Aesthetic

The FromString trait implementation for Aesthetic returns an Aesthetic variant based on the string provided.

source§

impl FromString for Balls

The FromString trait implementation for Balls returns an Balls variant based on the string provided.

source§

impl FromString for Circumcision

The FromString traits implementation for Circumcision returns a Circumcision variant.

source§

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.

source§

impl FromString for ID

Implementing FromString for ID enum to create an ID instance from a string.

source§

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.

source§

impl FromString for SizeType

The FromString trait implementation for SizeType returns a SizeType variant based on the string provided.

source§

impl FromString for Tier

The FromString trait implementation for Tier returns a variant of Tier.

source§

impl FromString for Veininess

Implementing FromString for Veininess enum to create a Veininess instance from a string.