pub struct VariantTy { /* private fields */ }
Expand description
Describes Variant
types.
This is a borrowed counterpart of VariantType
.
Essentially it’s a str
statically guaranteed to be a valid type string.
Implementations§
Source§impl VariantTy
impl VariantTy
Sourcepub fn new(type_string: &str) -> Result<&VariantTy, ()>
pub fn new(type_string: &str) -> Result<&VariantTy, ()>
Tries to create a &VariantTy
from a string slice.
Returns Ok
if the string is a valid type string, Err
otherwise.
Sourcepub unsafe fn from_str_unchecked(type_string: &str) -> &VariantTy
pub unsafe fn from_str_unchecked(type_string: &str) -> &VariantTy
Converts a type string into &VariantTy
without any checks.
Trait Implementations§
Source§impl Borrow<VariantTy> for VariantType
impl Borrow<VariantTy> for VariantType
Source§impl<'a> FromValueOptional<'a> for &'a VariantTy
impl<'a> FromValueOptional<'a> for &'a VariantTy
unsafe fn from_value_optional(value: &'a Value) -> Option<Self>
Source§impl<'a, 'b> PartialEq<&'a VariantTy> for VariantType
impl<'a, 'b> PartialEq<&'a VariantTy> for VariantType
Source§impl<'a, 'b> PartialEq<VariantTy> for VariantType
impl<'a, 'b> PartialEq<VariantTy> for VariantType
Source§impl<'a, 'b> PartialEq<VariantType> for &'a VariantTy
impl<'a, 'b> PartialEq<VariantType> for &'a VariantTy
Source§impl<'a, 'b> PartialEq<VariantType> for VariantTy
impl<'a, 'b> PartialEq<VariantType> for VariantTy
Source§impl SetValueOptional for VariantTy
impl SetValueOptional for VariantTy
unsafe fn set_value_optional(value: &mut Value, this: Option<&Self>)
Source§impl StaticType for VariantTy
impl StaticType for VariantTy
Source§fn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of
Self
.Source§impl ToOwned for VariantTy
impl ToOwned for VariantTy
Source§type Owned = VariantType
type Owned = VariantType
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> VariantType
fn to_owned(&self) -> VariantType
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Eq for VariantTy
impl StructuralPartialEq for VariantTy
impl Sync for VariantTy
Auto Trait Implementations§
impl Freeze for VariantTy
impl RefUnwindSafe for VariantTy
impl Send for VariantTy
impl !Sized for VariantTy
impl Unpin for VariantTy
impl UnwindSafe for VariantTy
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
Source§impl<T> ToSendValue for T
impl<T> ToSendValue for T
Source§fn to_send_value(&self) -> SendValue
fn to_send_value(&self) -> SendValue
Returns a
SendValue
clone of self
.