#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum VoiceId {
#[allow(missing_docs)] Aditi,
#[allow(missing_docs)] Amy,
#[allow(missing_docs)] Aria,
#[allow(missing_docs)] Arlet,
#[allow(missing_docs)] Arthur,
#[allow(missing_docs)] Astrid,
#[allow(missing_docs)] Ayanda,
#[allow(missing_docs)] Bianca,
#[allow(missing_docs)] Brian,
#[allow(missing_docs)] Camila,
#[allow(missing_docs)] Carla,
#[allow(missing_docs)] Carmen,
#[allow(missing_docs)] Celine,
#[allow(missing_docs)] Chantal,
#[allow(missing_docs)] Conchita,
#[allow(missing_docs)] Cristiano,
#[allow(missing_docs)] Daniel,
#[allow(missing_docs)] Dora,
#[allow(missing_docs)] Elin,
#[allow(missing_docs)] Emma,
#[allow(missing_docs)] Enrique,
#[allow(missing_docs)] Ewa,
#[allow(missing_docs)] Filiz,
#[allow(missing_docs)] Gabrielle,
#[allow(missing_docs)] Geraint,
#[allow(missing_docs)] Giorgio,
#[allow(missing_docs)] Gwyneth,
#[allow(missing_docs)] Hala,
#[allow(missing_docs)] Hannah,
#[allow(missing_docs)] Hans,
#[allow(missing_docs)] Hiujin,
#[allow(missing_docs)] Ida,
#[allow(missing_docs)] Ines,
#[allow(missing_docs)] Ivy,
#[allow(missing_docs)] Jacek,
#[allow(missing_docs)] Jan,
#[allow(missing_docs)] Joanna,
#[allow(missing_docs)] Joey,
#[allow(missing_docs)] Justin,
#[allow(missing_docs)] Kajal,
#[allow(missing_docs)] Karl,
#[allow(missing_docs)] Kendra,
#[allow(missing_docs)] Kevin,
#[allow(missing_docs)] Kimberly,
#[allow(missing_docs)] Laura,
#[allow(missing_docs)] Lea,
#[allow(missing_docs)] Liam,
#[allow(missing_docs)] Liv,
#[allow(missing_docs)] Lotte,
#[allow(missing_docs)] Lucia,
#[allow(missing_docs)] Lupe,
#[allow(missing_docs)] Mads,
#[allow(missing_docs)] Maja,
#[allow(missing_docs)] Marlene,
#[allow(missing_docs)] Mathieu,
#[allow(missing_docs)] Matthew,
#[allow(missing_docs)] Maxim,
#[allow(missing_docs)] Mia,
#[allow(missing_docs)] Miguel,
#[allow(missing_docs)] Mizuki,
#[allow(missing_docs)] Naja,
#[allow(missing_docs)] Nicole,
#[allow(missing_docs)] Ola,
#[allow(missing_docs)] Olivia,
#[allow(missing_docs)] Pedro,
#[allow(missing_docs)] Penelope,
#[allow(missing_docs)] Raveena,
#[allow(missing_docs)] Ricardo,
#[allow(missing_docs)] Ruben,
#[allow(missing_docs)] Russell,
#[allow(missing_docs)] Salli,
#[allow(missing_docs)] Seoyeon,
#[allow(missing_docs)] Suvi,
#[allow(missing_docs)] Takumi,
#[allow(missing_docs)] Tatyana,
#[allow(missing_docs)] Vicki,
#[allow(missing_docs)] Vitoria,
#[allow(missing_docs)] Zeina,
#[allow(missing_docs)] Zhiyu,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for VoiceId {
fn from(s: &str) -> Self {
match s {
"Aditi" => VoiceId::Aditi,
"Amy" => VoiceId::Amy,
"Aria" => VoiceId::Aria,
"Arlet" => VoiceId::Arlet,
"Arthur" => VoiceId::Arthur,
"Astrid" => VoiceId::Astrid,
"Ayanda" => VoiceId::Ayanda,
"Bianca" => VoiceId::Bianca,
"Brian" => VoiceId::Brian,
"Camila" => VoiceId::Camila,
"Carla" => VoiceId::Carla,
"Carmen" => VoiceId::Carmen,
"Celine" => VoiceId::Celine,
"Chantal" => VoiceId::Chantal,
"Conchita" => VoiceId::Conchita,
"Cristiano" => VoiceId::Cristiano,
"Daniel" => VoiceId::Daniel,
"Dora" => VoiceId::Dora,
"Elin" => VoiceId::Elin,
"Emma" => VoiceId::Emma,
"Enrique" => VoiceId::Enrique,
"Ewa" => VoiceId::Ewa,
"Filiz" => VoiceId::Filiz,
"Gabrielle" => VoiceId::Gabrielle,
"Geraint" => VoiceId::Geraint,
"Giorgio" => VoiceId::Giorgio,
"Gwyneth" => VoiceId::Gwyneth,
"Hala" => VoiceId::Hala,
"Hannah" => VoiceId::Hannah,
"Hans" => VoiceId::Hans,
"Hiujin" => VoiceId::Hiujin,
"Ida" => VoiceId::Ida,
"Ines" => VoiceId::Ines,
"Ivy" => VoiceId::Ivy,
"Jacek" => VoiceId::Jacek,
"Jan" => VoiceId::Jan,
"Joanna" => VoiceId::Joanna,
"Joey" => VoiceId::Joey,
"Justin" => VoiceId::Justin,
"Kajal" => VoiceId::Kajal,
"Karl" => VoiceId::Karl,
"Kendra" => VoiceId::Kendra,
"Kevin" => VoiceId::Kevin,
"Kimberly" => VoiceId::Kimberly,
"Laura" => VoiceId::Laura,
"Lea" => VoiceId::Lea,
"Liam" => VoiceId::Liam,
"Liv" => VoiceId::Liv,
"Lotte" => VoiceId::Lotte,
"Lucia" => VoiceId::Lucia,
"Lupe" => VoiceId::Lupe,
"Mads" => VoiceId::Mads,
"Maja" => VoiceId::Maja,
"Marlene" => VoiceId::Marlene,
"Mathieu" => VoiceId::Mathieu,
"Matthew" => VoiceId::Matthew,
"Maxim" => VoiceId::Maxim,
"Mia" => VoiceId::Mia,
"Miguel" => VoiceId::Miguel,
"Mizuki" => VoiceId::Mizuki,
"Naja" => VoiceId::Naja,
"Nicole" => VoiceId::Nicole,
"Ola" => VoiceId::Ola,
"Olivia" => VoiceId::Olivia,
"Pedro" => VoiceId::Pedro,
"Penelope" => VoiceId::Penelope,
"Raveena" => VoiceId::Raveena,
"Ricardo" => VoiceId::Ricardo,
"Ruben" => VoiceId::Ruben,
"Russell" => VoiceId::Russell,
"Salli" => VoiceId::Salli,
"Seoyeon" => VoiceId::Seoyeon,
"Suvi" => VoiceId::Suvi,
"Takumi" => VoiceId::Takumi,
"Tatyana" => VoiceId::Tatyana,
"Vicki" => VoiceId::Vicki,
"Vitoria" => VoiceId::Vitoria,
"Zeina" => VoiceId::Zeina,
"Zhiyu" => VoiceId::Zhiyu,
other => VoiceId::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for VoiceId {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(VoiceId::from(s))
}
}
impl VoiceId {
pub fn as_str(&self) -> &str {
match self {
VoiceId::Aditi => "Aditi",
VoiceId::Amy => "Amy",
VoiceId::Aria => "Aria",
VoiceId::Arlet => "Arlet",
VoiceId::Arthur => "Arthur",
VoiceId::Astrid => "Astrid",
VoiceId::Ayanda => "Ayanda",
VoiceId::Bianca => "Bianca",
VoiceId::Brian => "Brian",
VoiceId::Camila => "Camila",
VoiceId::Carla => "Carla",
VoiceId::Carmen => "Carmen",
VoiceId::Celine => "Celine",
VoiceId::Chantal => "Chantal",
VoiceId::Conchita => "Conchita",
VoiceId::Cristiano => "Cristiano",
VoiceId::Daniel => "Daniel",
VoiceId::Dora => "Dora",
VoiceId::Elin => "Elin",
VoiceId::Emma => "Emma",
VoiceId::Enrique => "Enrique",
VoiceId::Ewa => "Ewa",
VoiceId::Filiz => "Filiz",
VoiceId::Gabrielle => "Gabrielle",
VoiceId::Geraint => "Geraint",
VoiceId::Giorgio => "Giorgio",
VoiceId::Gwyneth => "Gwyneth",
VoiceId::Hala => "Hala",
VoiceId::Hannah => "Hannah",
VoiceId::Hans => "Hans",
VoiceId::Hiujin => "Hiujin",
VoiceId::Ida => "Ida",
VoiceId::Ines => "Ines",
VoiceId::Ivy => "Ivy",
VoiceId::Jacek => "Jacek",
VoiceId::Jan => "Jan",
VoiceId::Joanna => "Joanna",
VoiceId::Joey => "Joey",
VoiceId::Justin => "Justin",
VoiceId::Kajal => "Kajal",
VoiceId::Karl => "Karl",
VoiceId::Kendra => "Kendra",
VoiceId::Kevin => "Kevin",
VoiceId::Kimberly => "Kimberly",
VoiceId::Laura => "Laura",
VoiceId::Lea => "Lea",
VoiceId::Liam => "Liam",
VoiceId::Liv => "Liv",
VoiceId::Lotte => "Lotte",
VoiceId::Lucia => "Lucia",
VoiceId::Lupe => "Lupe",
VoiceId::Mads => "Mads",
VoiceId::Maja => "Maja",
VoiceId::Marlene => "Marlene",
VoiceId::Mathieu => "Mathieu",
VoiceId::Matthew => "Matthew",
VoiceId::Maxim => "Maxim",
VoiceId::Mia => "Mia",
VoiceId::Miguel => "Miguel",
VoiceId::Mizuki => "Mizuki",
VoiceId::Naja => "Naja",
VoiceId::Nicole => "Nicole",
VoiceId::Ola => "Ola",
VoiceId::Olivia => "Olivia",
VoiceId::Pedro => "Pedro",
VoiceId::Penelope => "Penelope",
VoiceId::Raveena => "Raveena",
VoiceId::Ricardo => "Ricardo",
VoiceId::Ruben => "Ruben",
VoiceId::Russell => "Russell",
VoiceId::Salli => "Salli",
VoiceId::Seoyeon => "Seoyeon",
VoiceId::Suvi => "Suvi",
VoiceId::Takumi => "Takumi",
VoiceId::Tatyana => "Tatyana",
VoiceId::Vicki => "Vicki",
VoiceId::Vitoria => "Vitoria",
VoiceId::Zeina => "Zeina",
VoiceId::Zhiyu => "Zhiyu",
VoiceId::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"Aditi",
"Amy",
"Aria",
"Arlet",
"Arthur",
"Astrid",
"Ayanda",
"Bianca",
"Brian",
"Camila",
"Carla",
"Carmen",
"Celine",
"Chantal",
"Conchita",
"Cristiano",
"Daniel",
"Dora",
"Elin",
"Emma",
"Enrique",
"Ewa",
"Filiz",
"Gabrielle",
"Geraint",
"Giorgio",
"Gwyneth",
"Hala",
"Hannah",
"Hans",
"Hiujin",
"Ida",
"Ines",
"Ivy",
"Jacek",
"Jan",
"Joanna",
"Joey",
"Justin",
"Kajal",
"Karl",
"Kendra",
"Kevin",
"Kimberly",
"Laura",
"Lea",
"Liam",
"Liv",
"Lotte",
"Lucia",
"Lupe",
"Mads",
"Maja",
"Marlene",
"Mathieu",
"Matthew",
"Maxim",
"Mia",
"Miguel",
"Mizuki",
"Naja",
"Nicole",
"Ola",
"Olivia",
"Pedro",
"Penelope",
"Raveena",
"Ricardo",
"Ruben",
"Russell",
"Salli",
"Seoyeon",
"Suvi",
"Takumi",
"Tatyana",
"Vicki",
"Vitoria",
"Zeina",
"Zhiyu",
]
}
}
impl AsRef<str> for VoiceId {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum TextType {
#[allow(missing_docs)] Ssml,
#[allow(missing_docs)] Text,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for TextType {
fn from(s: &str) -> Self {
match s {
"ssml" => TextType::Ssml,
"text" => TextType::Text,
other => TextType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for TextType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TextType::from(s))
}
}
impl TextType {
pub fn as_str(&self) -> &str {
match self {
TextType::Ssml => "ssml",
TextType::Text => "text",
TextType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["ssml", "text"]
}
}
impl AsRef<str> for TextType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum SpeechMarkType {
#[allow(missing_docs)] Sentence,
#[allow(missing_docs)] Ssml,
#[allow(missing_docs)] Viseme,
#[allow(missing_docs)] Word,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for SpeechMarkType {
fn from(s: &str) -> Self {
match s {
"sentence" => SpeechMarkType::Sentence,
"ssml" => SpeechMarkType::Ssml,
"viseme" => SpeechMarkType::Viseme,
"word" => SpeechMarkType::Word,
other => SpeechMarkType::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for SpeechMarkType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SpeechMarkType::from(s))
}
}
impl SpeechMarkType {
pub fn as_str(&self) -> &str {
match self {
SpeechMarkType::Sentence => "sentence",
SpeechMarkType::Ssml => "ssml",
SpeechMarkType::Viseme => "viseme",
SpeechMarkType::Word => "word",
SpeechMarkType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["sentence", "ssml", "viseme", "word"]
}
}
impl AsRef<str> for SpeechMarkType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum OutputFormat {
#[allow(missing_docs)] Json,
#[allow(missing_docs)] Mp3,
#[allow(missing_docs)] OggVorbis,
#[allow(missing_docs)] Pcm,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for OutputFormat {
fn from(s: &str) -> Self {
match s {
"json" => OutputFormat::Json,
"mp3" => OutputFormat::Mp3,
"ogg_vorbis" => OutputFormat::OggVorbis,
"pcm" => OutputFormat::Pcm,
other => OutputFormat::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for OutputFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(OutputFormat::from(s))
}
}
impl OutputFormat {
pub fn as_str(&self) -> &str {
match self {
OutputFormat::Json => "json",
OutputFormat::Mp3 => "mp3",
OutputFormat::OggVorbis => "ogg_vorbis",
OutputFormat::Pcm => "pcm",
OutputFormat::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["json", "mp3", "ogg_vorbis", "pcm"]
}
}
impl AsRef<str> for OutputFormat {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum LanguageCode {
#[allow(missing_docs)] ArAe,
#[allow(missing_docs)] Arb,
#[allow(missing_docs)] CaEs,
#[allow(missing_docs)] CmnCn,
#[allow(missing_docs)] CyGb,
#[allow(missing_docs)] DaDk,
#[allow(missing_docs)] DeAt,
#[allow(missing_docs)] DeDe,
#[allow(missing_docs)] EnAu,
#[allow(missing_docs)] EnGb,
#[allow(missing_docs)] EnGbWls,
#[allow(missing_docs)] EnIn,
#[allow(missing_docs)] EnNz,
#[allow(missing_docs)] EnUs,
#[allow(missing_docs)] EnZa,
#[allow(missing_docs)] EsEs,
#[allow(missing_docs)] EsMx,
#[allow(missing_docs)] EsUs,
#[allow(missing_docs)] FiFi,
#[allow(missing_docs)] FrCa,
#[allow(missing_docs)] FrFr,
#[allow(missing_docs)] HiIn,
#[allow(missing_docs)] IsIs,
#[allow(missing_docs)] ItIt,
#[allow(missing_docs)] JaJp,
#[allow(missing_docs)] KoKr,
#[allow(missing_docs)] NbNo,
#[allow(missing_docs)] NlNl,
#[allow(missing_docs)] PlPl,
#[allow(missing_docs)] PtBr,
#[allow(missing_docs)] PtPt,
#[allow(missing_docs)] RoRo,
#[allow(missing_docs)] RuRu,
#[allow(missing_docs)] SvSe,
#[allow(missing_docs)] TrTr,
#[allow(missing_docs)] YueCn,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for LanguageCode {
fn from(s: &str) -> Self {
match s {
"ar-AE" => LanguageCode::ArAe,
"arb" => LanguageCode::Arb,
"ca-ES" => LanguageCode::CaEs,
"cmn-CN" => LanguageCode::CmnCn,
"cy-GB" => LanguageCode::CyGb,
"da-DK" => LanguageCode::DaDk,
"de-AT" => LanguageCode::DeAt,
"de-DE" => LanguageCode::DeDe,
"en-AU" => LanguageCode::EnAu,
"en-GB" => LanguageCode::EnGb,
"en-GB-WLS" => LanguageCode::EnGbWls,
"en-IN" => LanguageCode::EnIn,
"en-NZ" => LanguageCode::EnNz,
"en-US" => LanguageCode::EnUs,
"en-ZA" => LanguageCode::EnZa,
"es-ES" => LanguageCode::EsEs,
"es-MX" => LanguageCode::EsMx,
"es-US" => LanguageCode::EsUs,
"fi-FI" => LanguageCode::FiFi,
"fr-CA" => LanguageCode::FrCa,
"fr-FR" => LanguageCode::FrFr,
"hi-IN" => LanguageCode::HiIn,
"is-IS" => LanguageCode::IsIs,
"it-IT" => LanguageCode::ItIt,
"ja-JP" => LanguageCode::JaJp,
"ko-KR" => LanguageCode::KoKr,
"nb-NO" => LanguageCode::NbNo,
"nl-NL" => LanguageCode::NlNl,
"pl-PL" => LanguageCode::PlPl,
"pt-BR" => LanguageCode::PtBr,
"pt-PT" => LanguageCode::PtPt,
"ro-RO" => LanguageCode::RoRo,
"ru-RU" => LanguageCode::RuRu,
"sv-SE" => LanguageCode::SvSe,
"tr-TR" => LanguageCode::TrTr,
"yue-CN" => LanguageCode::YueCn,
other => LanguageCode::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for LanguageCode {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(LanguageCode::from(s))
}
}
impl LanguageCode {
pub fn as_str(&self) -> &str {
match self {
LanguageCode::ArAe => "ar-AE",
LanguageCode::Arb => "arb",
LanguageCode::CaEs => "ca-ES",
LanguageCode::CmnCn => "cmn-CN",
LanguageCode::CyGb => "cy-GB",
LanguageCode::DaDk => "da-DK",
LanguageCode::DeAt => "de-AT",
LanguageCode::DeDe => "de-DE",
LanguageCode::EnAu => "en-AU",
LanguageCode::EnGb => "en-GB",
LanguageCode::EnGbWls => "en-GB-WLS",
LanguageCode::EnIn => "en-IN",
LanguageCode::EnNz => "en-NZ",
LanguageCode::EnUs => "en-US",
LanguageCode::EnZa => "en-ZA",
LanguageCode::EsEs => "es-ES",
LanguageCode::EsMx => "es-MX",
LanguageCode::EsUs => "es-US",
LanguageCode::FiFi => "fi-FI",
LanguageCode::FrCa => "fr-CA",
LanguageCode::FrFr => "fr-FR",
LanguageCode::HiIn => "hi-IN",
LanguageCode::IsIs => "is-IS",
LanguageCode::ItIt => "it-IT",
LanguageCode::JaJp => "ja-JP",
LanguageCode::KoKr => "ko-KR",
LanguageCode::NbNo => "nb-NO",
LanguageCode::NlNl => "nl-NL",
LanguageCode::PlPl => "pl-PL",
LanguageCode::PtBr => "pt-BR",
LanguageCode::PtPt => "pt-PT",
LanguageCode::RoRo => "ro-RO",
LanguageCode::RuRu => "ru-RU",
LanguageCode::SvSe => "sv-SE",
LanguageCode::TrTr => "tr-TR",
LanguageCode::YueCn => "yue-CN",
LanguageCode::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"ar-AE",
"arb",
"ca-ES",
"cmn-CN",
"cy-GB",
"da-DK",
"de-AT",
"de-DE",
"en-AU",
"en-GB",
"en-GB-WLS",
"en-IN",
"en-NZ",
"en-US",
"en-ZA",
"es-ES",
"es-MX",
"es-US",
"fi-FI",
"fr-CA",
"fr-FR",
"hi-IN",
"is-IS",
"it-IT",
"ja-JP",
"ko-KR",
"nb-NO",
"nl-NL",
"pl-PL",
"pt-BR",
"pt-PT",
"ro-RO",
"ru-RU",
"sv-SE",
"tr-TR",
"yue-CN",
]
}
}
impl AsRef<str> for LanguageCode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum Engine {
#[allow(missing_docs)] Neural,
#[allow(missing_docs)] Standard,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for Engine {
fn from(s: &str) -> Self {
match s {
"neural" => Engine::Neural,
"standard" => Engine::Standard,
other => Engine::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for Engine {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Engine::from(s))
}
}
impl Engine {
pub fn as_str(&self) -> &str {
match self {
Engine::Neural => "neural",
Engine::Standard => "standard",
Engine::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["neural", "standard"]
}
}
impl AsRef<str> for Engine {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SynthesisTask {
#[doc(hidden)]
pub engine: std::option::Option<crate::model::Engine>,
#[doc(hidden)]
pub task_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub task_status: std::option::Option<crate::model::TaskStatus>,
#[doc(hidden)]
pub task_status_reason: std::option::Option<std::string::String>,
#[doc(hidden)]
pub output_uri: std::option::Option<std::string::String>,
#[doc(hidden)]
pub creation_time: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub request_characters: i32,
#[doc(hidden)]
pub sns_topic_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub lexicon_names: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub output_format: std::option::Option<crate::model::OutputFormat>,
#[doc(hidden)]
pub sample_rate: std::option::Option<std::string::String>,
#[doc(hidden)]
pub speech_mark_types: std::option::Option<std::vec::Vec<crate::model::SpeechMarkType>>,
#[doc(hidden)]
pub text_type: std::option::Option<crate::model::TextType>,
#[doc(hidden)]
pub voice_id: std::option::Option<crate::model::VoiceId>,
#[doc(hidden)]
pub language_code: std::option::Option<crate::model::LanguageCode>,
}
impl SynthesisTask {
pub fn engine(&self) -> std::option::Option<&crate::model::Engine> {
self.engine.as_ref()
}
pub fn task_id(&self) -> std::option::Option<&str> {
self.task_id.as_deref()
}
pub fn task_status(&self) -> std::option::Option<&crate::model::TaskStatus> {
self.task_status.as_ref()
}
pub fn task_status_reason(&self) -> std::option::Option<&str> {
self.task_status_reason.as_deref()
}
pub fn output_uri(&self) -> std::option::Option<&str> {
self.output_uri.as_deref()
}
pub fn creation_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.creation_time.as_ref()
}
pub fn request_characters(&self) -> i32 {
self.request_characters
}
pub fn sns_topic_arn(&self) -> std::option::Option<&str> {
self.sns_topic_arn.as_deref()
}
pub fn lexicon_names(&self) -> std::option::Option<&[std::string::String]> {
self.lexicon_names.as_deref()
}
pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
self.output_format.as_ref()
}
pub fn sample_rate(&self) -> std::option::Option<&str> {
self.sample_rate.as_deref()
}
pub fn speech_mark_types(&self) -> std::option::Option<&[crate::model::SpeechMarkType]> {
self.speech_mark_types.as_deref()
}
pub fn text_type(&self) -> std::option::Option<&crate::model::TextType> {
self.text_type.as_ref()
}
pub fn voice_id(&self) -> std::option::Option<&crate::model::VoiceId> {
self.voice_id.as_ref()
}
pub fn language_code(&self) -> std::option::Option<&crate::model::LanguageCode> {
self.language_code.as_ref()
}
}
pub mod synthesis_task {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) engine: std::option::Option<crate::model::Engine>,
pub(crate) task_id: std::option::Option<std::string::String>,
pub(crate) task_status: std::option::Option<crate::model::TaskStatus>,
pub(crate) task_status_reason: std::option::Option<std::string::String>,
pub(crate) output_uri: std::option::Option<std::string::String>,
pub(crate) creation_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) request_characters: std::option::Option<i32>,
pub(crate) sns_topic_arn: std::option::Option<std::string::String>,
pub(crate) lexicon_names: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
pub(crate) sample_rate: std::option::Option<std::string::String>,
pub(crate) speech_mark_types:
std::option::Option<std::vec::Vec<crate::model::SpeechMarkType>>,
pub(crate) text_type: std::option::Option<crate::model::TextType>,
pub(crate) voice_id: std::option::Option<crate::model::VoiceId>,
pub(crate) language_code: std::option::Option<crate::model::LanguageCode>,
}
impl Builder {
pub fn engine(mut self, input: crate::model::Engine) -> Self {
self.engine = Some(input);
self
}
pub fn set_engine(mut self, input: std::option::Option<crate::model::Engine>) -> Self {
self.engine = input;
self
}
pub fn task_id(mut self, input: impl Into<std::string::String>) -> Self {
self.task_id = Some(input.into());
self
}
pub fn set_task_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.task_id = input;
self
}
pub fn task_status(mut self, input: crate::model::TaskStatus) -> Self {
self.task_status = Some(input);
self
}
pub fn set_task_status(
mut self,
input: std::option::Option<crate::model::TaskStatus>,
) -> Self {
self.task_status = input;
self
}
pub fn task_status_reason(mut self, input: impl Into<std::string::String>) -> Self {
self.task_status_reason = Some(input.into());
self
}
pub fn set_task_status_reason(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.task_status_reason = input;
self
}
pub fn output_uri(mut self, input: impl Into<std::string::String>) -> Self {
self.output_uri = Some(input.into());
self
}
pub fn set_output_uri(mut self, input: std::option::Option<std::string::String>) -> Self {
self.output_uri = input;
self
}
pub fn creation_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.creation_time = Some(input);
self
}
pub fn set_creation_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.creation_time = input;
self
}
pub fn request_characters(mut self, input: i32) -> Self {
self.request_characters = Some(input);
self
}
pub fn set_request_characters(mut self, input: std::option::Option<i32>) -> Self {
self.request_characters = input;
self
}
pub fn sns_topic_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.sns_topic_arn = Some(input.into());
self
}
pub fn set_sns_topic_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sns_topic_arn = input;
self
}
pub fn lexicon_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.lexicon_names.unwrap_or_default();
v.push(input.into());
self.lexicon_names = Some(v);
self
}
pub fn set_lexicon_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.lexicon_names = input;
self
}
pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
self.output_format = Some(input);
self
}
pub fn set_output_format(
mut self,
input: std::option::Option<crate::model::OutputFormat>,
) -> Self {
self.output_format = input;
self
}
pub fn sample_rate(mut self, input: impl Into<std::string::String>) -> Self {
self.sample_rate = Some(input.into());
self
}
pub fn set_sample_rate(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sample_rate = input;
self
}
pub fn speech_mark_types(mut self, input: crate::model::SpeechMarkType) -> Self {
let mut v = self.speech_mark_types.unwrap_or_default();
v.push(input);
self.speech_mark_types = Some(v);
self
}
pub fn set_speech_mark_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SpeechMarkType>>,
) -> Self {
self.speech_mark_types = input;
self
}
pub fn text_type(mut self, input: crate::model::TextType) -> Self {
self.text_type = Some(input);
self
}
pub fn set_text_type(mut self, input: std::option::Option<crate::model::TextType>) -> Self {
self.text_type = input;
self
}
pub fn voice_id(mut self, input: crate::model::VoiceId) -> Self {
self.voice_id = Some(input);
self
}
pub fn set_voice_id(mut self, input: std::option::Option<crate::model::VoiceId>) -> Self {
self.voice_id = input;
self
}
pub fn language_code(mut self, input: crate::model::LanguageCode) -> Self {
self.language_code = Some(input);
self
}
pub fn set_language_code(
mut self,
input: std::option::Option<crate::model::LanguageCode>,
) -> Self {
self.language_code = input;
self
}
pub fn build(self) -> crate::model::SynthesisTask {
crate::model::SynthesisTask {
engine: self.engine,
task_id: self.task_id,
task_status: self.task_status,
task_status_reason: self.task_status_reason,
output_uri: self.output_uri,
creation_time: self.creation_time,
request_characters: self.request_characters.unwrap_or_default(),
sns_topic_arn: self.sns_topic_arn,
lexicon_names: self.lexicon_names,
output_format: self.output_format,
sample_rate: self.sample_rate,
speech_mark_types: self.speech_mark_types,
text_type: self.text_type,
voice_id: self.voice_id,
language_code: self.language_code,
}
}
}
}
impl SynthesisTask {
pub fn builder() -> crate::model::synthesis_task::Builder {
crate::model::synthesis_task::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum TaskStatus {
#[allow(missing_docs)] Completed,
#[allow(missing_docs)] Failed,
#[allow(missing_docs)] InProgress,
#[allow(missing_docs)] Scheduled,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for TaskStatus {
fn from(s: &str) -> Self {
match s {
"completed" => TaskStatus::Completed,
"failed" => TaskStatus::Failed,
"inProgress" => TaskStatus::InProgress,
"scheduled" => TaskStatus::Scheduled,
other => TaskStatus::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for TaskStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TaskStatus::from(s))
}
}
impl TaskStatus {
pub fn as_str(&self) -> &str {
match self {
TaskStatus::Completed => "completed",
TaskStatus::Failed => "failed",
TaskStatus::InProgress => "inProgress",
TaskStatus::Scheduled => "scheduled",
TaskStatus::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["completed", "failed", "inProgress", "scheduled"]
}
}
impl AsRef<str> for TaskStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LexiconDescription {
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub attributes: std::option::Option<crate::model::LexiconAttributes>,
}
impl LexiconDescription {
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn attributes(&self) -> std::option::Option<&crate::model::LexiconAttributes> {
self.attributes.as_ref()
}
}
pub mod lexicon_description {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) attributes: std::option::Option<crate::model::LexiconAttributes>,
}
impl Builder {
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn attributes(mut self, input: crate::model::LexiconAttributes) -> Self {
self.attributes = Some(input);
self
}
pub fn set_attributes(
mut self,
input: std::option::Option<crate::model::LexiconAttributes>,
) -> Self {
self.attributes = input;
self
}
pub fn build(self) -> crate::model::LexiconDescription {
crate::model::LexiconDescription {
name: self.name,
attributes: self.attributes,
}
}
}
}
impl LexiconDescription {
pub fn builder() -> crate::model::lexicon_description::Builder {
crate::model::lexicon_description::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct LexiconAttributes {
#[doc(hidden)]
pub alphabet: std::option::Option<std::string::String>,
#[doc(hidden)]
pub language_code: std::option::Option<crate::model::LanguageCode>,
#[doc(hidden)]
pub last_modified: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub lexicon_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub lexemes_count: i32,
#[doc(hidden)]
pub size: i32,
}
impl LexiconAttributes {
pub fn alphabet(&self) -> std::option::Option<&str> {
self.alphabet.as_deref()
}
pub fn language_code(&self) -> std::option::Option<&crate::model::LanguageCode> {
self.language_code.as_ref()
}
pub fn last_modified(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.last_modified.as_ref()
}
pub fn lexicon_arn(&self) -> std::option::Option<&str> {
self.lexicon_arn.as_deref()
}
pub fn lexemes_count(&self) -> i32 {
self.lexemes_count
}
pub fn size(&self) -> i32 {
self.size
}
}
pub mod lexicon_attributes {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) alphabet: std::option::Option<std::string::String>,
pub(crate) language_code: std::option::Option<crate::model::LanguageCode>,
pub(crate) last_modified: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) lexicon_arn: std::option::Option<std::string::String>,
pub(crate) lexemes_count: std::option::Option<i32>,
pub(crate) size: std::option::Option<i32>,
}
impl Builder {
pub fn alphabet(mut self, input: impl Into<std::string::String>) -> Self {
self.alphabet = Some(input.into());
self
}
pub fn set_alphabet(mut self, input: std::option::Option<std::string::String>) -> Self {
self.alphabet = input;
self
}
pub fn language_code(mut self, input: crate::model::LanguageCode) -> Self {
self.language_code = Some(input);
self
}
pub fn set_language_code(
mut self,
input: std::option::Option<crate::model::LanguageCode>,
) -> Self {
self.language_code = input;
self
}
pub fn last_modified(mut self, input: aws_smithy_types::DateTime) -> Self {
self.last_modified = Some(input);
self
}
pub fn set_last_modified(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.last_modified = input;
self
}
pub fn lexicon_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.lexicon_arn = Some(input.into());
self
}
pub fn set_lexicon_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.lexicon_arn = input;
self
}
pub fn lexemes_count(mut self, input: i32) -> Self {
self.lexemes_count = Some(input);
self
}
pub fn set_lexemes_count(mut self, input: std::option::Option<i32>) -> Self {
self.lexemes_count = input;
self
}
pub fn size(mut self, input: i32) -> Self {
self.size = Some(input);
self
}
pub fn set_size(mut self, input: std::option::Option<i32>) -> Self {
self.size = input;
self
}
pub fn build(self) -> crate::model::LexiconAttributes {
crate::model::LexiconAttributes {
alphabet: self.alphabet,
language_code: self.language_code,
last_modified: self.last_modified,
lexicon_arn: self.lexicon_arn,
lexemes_count: self.lexemes_count.unwrap_or_default(),
size: self.size.unwrap_or_default(),
}
}
}
}
impl LexiconAttributes {
pub fn builder() -> crate::model::lexicon_attributes::Builder {
crate::model::lexicon_attributes::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Lexicon {
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl Lexicon {
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
impl std::fmt::Debug for Lexicon {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Lexicon");
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("name", &self.name);
formatter.finish()
}
}
pub mod lexicon {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) content: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn build(self) -> crate::model::Lexicon {
crate::model::Lexicon {
content: self.content,
name: self.name,
}
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("name", &self.name);
formatter.finish()
}
}
}
impl Lexicon {
pub fn builder() -> crate::model::lexicon::Builder {
crate::model::lexicon::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Voice {
#[doc(hidden)]
pub gender: std::option::Option<crate::model::Gender>,
#[doc(hidden)]
pub id: std::option::Option<crate::model::VoiceId>,
#[doc(hidden)]
pub language_code: std::option::Option<crate::model::LanguageCode>,
#[doc(hidden)]
pub language_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub additional_language_codes: std::option::Option<std::vec::Vec<crate::model::LanguageCode>>,
#[doc(hidden)]
pub supported_engines: std::option::Option<std::vec::Vec<crate::model::Engine>>,
}
impl Voice {
pub fn gender(&self) -> std::option::Option<&crate::model::Gender> {
self.gender.as_ref()
}
pub fn id(&self) -> std::option::Option<&crate::model::VoiceId> {
self.id.as_ref()
}
pub fn language_code(&self) -> std::option::Option<&crate::model::LanguageCode> {
self.language_code.as_ref()
}
pub fn language_name(&self) -> std::option::Option<&str> {
self.language_name.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn additional_language_codes(&self) -> std::option::Option<&[crate::model::LanguageCode]> {
self.additional_language_codes.as_deref()
}
pub fn supported_engines(&self) -> std::option::Option<&[crate::model::Engine]> {
self.supported_engines.as_deref()
}
}
pub mod voice {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) gender: std::option::Option<crate::model::Gender>,
pub(crate) id: std::option::Option<crate::model::VoiceId>,
pub(crate) language_code: std::option::Option<crate::model::LanguageCode>,
pub(crate) language_name: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) additional_language_codes:
std::option::Option<std::vec::Vec<crate::model::LanguageCode>>,
pub(crate) supported_engines: std::option::Option<std::vec::Vec<crate::model::Engine>>,
}
impl Builder {
pub fn gender(mut self, input: crate::model::Gender) -> Self {
self.gender = Some(input);
self
}
pub fn set_gender(mut self, input: std::option::Option<crate::model::Gender>) -> Self {
self.gender = input;
self
}
pub fn id(mut self, input: crate::model::VoiceId) -> Self {
self.id = Some(input);
self
}
pub fn set_id(mut self, input: std::option::Option<crate::model::VoiceId>) -> Self {
self.id = input;
self
}
pub fn language_code(mut self, input: crate::model::LanguageCode) -> Self {
self.language_code = Some(input);
self
}
pub fn set_language_code(
mut self,
input: std::option::Option<crate::model::LanguageCode>,
) -> Self {
self.language_code = input;
self
}
pub fn language_name(mut self, input: impl Into<std::string::String>) -> Self {
self.language_name = Some(input.into());
self
}
pub fn set_language_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.language_name = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn additional_language_codes(mut self, input: crate::model::LanguageCode) -> Self {
let mut v = self.additional_language_codes.unwrap_or_default();
v.push(input);
self.additional_language_codes = Some(v);
self
}
pub fn set_additional_language_codes(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::LanguageCode>>,
) -> Self {
self.additional_language_codes = input;
self
}
pub fn supported_engines(mut self, input: crate::model::Engine) -> Self {
let mut v = self.supported_engines.unwrap_or_default();
v.push(input);
self.supported_engines = Some(v);
self
}
pub fn set_supported_engines(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Engine>>,
) -> Self {
self.supported_engines = input;
self
}
pub fn build(self) -> crate::model::Voice {
crate::model::Voice {
gender: self.gender,
id: self.id,
language_code: self.language_code,
language_name: self.language_name,
name: self.name,
additional_language_codes: self.additional_language_codes,
supported_engines: self.supported_engines,
}
}
}
}
impl Voice {
pub fn builder() -> crate::model::voice::Builder {
crate::model::voice::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum Gender {
#[allow(missing_docs)] Female,
#[allow(missing_docs)] Male,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for Gender {
fn from(s: &str) -> Self {
match s {
"Female" => Gender::Female,
"Male" => Gender::Male,
other => Gender::Unknown(crate::types::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for Gender {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Gender::from(s))
}
}
impl Gender {
pub fn as_str(&self) -> &str {
match self {
Gender::Female => "Female",
Gender::Male => "Male",
Gender::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&["Female", "Male"]
}
}
impl AsRef<str> for Gender {
fn as_ref(&self) -> &str {
self.as_str()
}
}