Enum ScalarContents

Source
#[non_exhaustive]
pub enum ScalarContents<'a> {
Show 17 variants String(Cow<'a, str>), Bytes(Cow<'a, [u8]>), I8(i8), I16(i16), I32(i32), I64(i64), I128(i128), U8(u8), U16(u16), U32(u32), U64(u64), U128(u128), F32(f32), F64(f64), Boolean(bool), Nothing, Unknown,
}
Expand description

Represents the contents of a scalar value with a lifetime. This allows safe access to the actual values stored in memory.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

String(Cow<'a, str>)

A string value

§

Bytes(Cow<'a, [u8]>)

A byte array

§

I8(i8)

An i8 value

§

I16(i16)

An i16 value

§

I32(i32)

An i32 value

§

I64(i64)

An i64 value

§

I128(i128)

An i128 value

§

U8(u8)

A u8 value

§

U16(u16)

A u16 value

§

U32(u32)

A u32 value

§

U64(u64)

A u64 value

§

U128(u128)

A u128 value

§

F32(f32)

An f32 value

§

F64(f64)

An f64 value

§

Boolean(bool)

A boolean value

§

Nothing

Nothing (empty tuple)

§

Unknown

Unknown scalar type

Trait Implementations§

Source§

impl<'a> Debug for ScalarContents<'a>

Source§

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

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

impl Display for ScalarContents<'_>

Source§

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

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

impl<'a> PartialEq for ScalarContents<'a>

Source§

fn eq(&self, other: &ScalarContents<'a>) -> 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> StructuralPartialEq for ScalarContents<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ScalarContents<'a>

§

impl<'a> RefUnwindSafe for ScalarContents<'a>

§

impl<'a> Send for ScalarContents<'a>

§

impl<'a> Sync for ScalarContents<'a>

§

impl<'a> Unpin for ScalarContents<'a>

§

impl<'a> UnwindSafe for ScalarContents<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.