Struct VariantTy

Source
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

Source

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.

Source

pub unsafe fn from_str_unchecked(type_string: &str) -> &VariantTy

Converts a type string into &VariantTy without any checks.

Source

pub fn to_str(&self) -> &str

Converts to a string slice.

Trait Implementations§

Source§

impl Borrow<VariantTy> for VariantType

Source§

fn borrow(&self) -> &VariantTy

Immutably borrows from an owned value. Read more
Source§

impl Debug for VariantTy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for VariantTy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> FromValueOptional<'a> for &'a VariantTy

Source§

unsafe fn from_value_optional(value: &'a Value) -> Option<Self>

Source§

impl Hash for VariantTy

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
Source§

impl<'a> Into<Cow<'a, VariantTy>> for &'a VariantTy

Source§

fn into(self) -> Cow<'a, VariantTy>

Converts this type into the (usually inferred) input type.
Source§

impl<'a, 'b> PartialEq<&'a VariantTy> for Cow<'b, VariantTy>

Source§

fn eq(&self, other: &&'a VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<&'a VariantTy> for String

Source§

fn eq(&self, other: &&'a VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<&'a VariantTy> for VariantType

Source§

fn eq(&self, other: &&'a VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<&'a VariantTy> for str

Source§

fn eq(&self, other: &&'a VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<&'a str> for VariantTy

Source§

fn eq(&self, other: &&'a str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<Cow<'b, VariantTy>> for &'a VariantTy

Source§

fn eq(&self, other: &Cow<'b, VariantTy>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<String> for &'a VariantTy

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<String> for VariantTy

Source§

fn eq(&self, other: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<VariantTy> for &'a str

Source§

fn eq(&self, other: &VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<VariantTy> for String

Source§

fn eq(&self, other: &VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<VariantTy> for VariantType

Source§

fn eq(&self, other: &VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<VariantTy> for str

Source§

fn eq(&self, other: &VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<VariantType> for &'a VariantTy

Source§

fn eq(&self, other: &VariantType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<VariantType> for VariantTy

Source§

fn eq(&self, other: &VariantType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<str> for &'a VariantTy

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<str> for VariantTy

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for VariantTy

Source§

fn eq(&self, other: &VariantTy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SetValue for VariantTy

Source§

unsafe fn set_value(value: &mut Value, this: &Self)

Source§

impl SetValueOptional for VariantTy

Source§

unsafe fn set_value_optional(value: &mut Value, this: Option<&Self>)

Source§

impl StaticType for VariantTy

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl ToOwned for VariantTy

Source§

type Owned = VariantType

The resulting type after obtaining ownership.
Source§

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)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl Eq for VariantTy

Source§

impl StructuralPartialEq for VariantTy

Source§

impl Sync for VariantTy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ToSendValue for T
where T: SetValue + Send + ToValue + ?Sized,

Source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToValue for T
where T: SetValue + ?Sized,

Source§

fn to_value(&self) -> Value

Returns a Value clone of self.
Source§

fn to_value_type(&self) -> Type

Returns the type identifer of self. Read more