pub enum Text {
String(String),
List(Vec<String>),
}
Variants§
Implementations§
source§impl Text
impl Text
sourcepub fn as_string_mut(&mut self) -> Option<&mut String>
pub fn as_string_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Text::String
, otherwise None
sourcepub fn as_string(&self) -> Option<&String>
pub fn as_string(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Text::String
, otherwise None
sourcepub fn into_string(self) -> Result<String, Self>
pub fn into_string(self) -> Result<String, Self>
Returns the inner fields if this is a Text::String
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_list_mut(&mut self) -> Option<&mut Vec<String>>
pub fn as_list_mut(&mut self) -> Option<&mut Vec<String>>
Optionally returns mutable references to the inner fields if this is a Text::List
, otherwise None
Trait Implementations§
source§impl<'de> Deserialize<'de> for Text
impl<'de> Deserialize<'de> for Text
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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