OwnedValue

Enum OwnedValue 

Source
pub enum OwnedValue<'ty> {
Show 17 variants U64(u64), U32(u32), U16(u16), U8(u8), I64(i64), I32(i32), I16(i16), I8(i8), F32(f32), F64(f64), Bool(bool), String(String), Vec(Box<dyn VecInstance<'ty> + 'ty>), Struct(Box<dyn StructInstance<'ty> + 'ty>), Enum(Box<dyn EnumInstance<'ty> + 'ty>), Bytes(Bytes), Option(Box<dyn OptionInstance<'ty> + 'ty>),
}
Expand description

An enum containing an owned copy of a Value

Variants§

§

U64(u64)

§

U32(u32)

§

U16(u16)

§

U8(u8)

§

I64(i64)

§

I32(i32)

§

I16(i16)

§

I8(i8)

§

F32(f32)

§

F64(f64)

§

Bool(bool)

§

String(String)

§

Vec(Box<dyn VecInstance<'ty> + 'ty>)

§

Struct(Box<dyn StructInstance<'ty> + 'ty>)

§

Enum(Box<dyn EnumInstance<'ty> + 'ty>)

§

Bytes(Bytes)

§

Option(Box<dyn OptionInstance<'ty> + 'ty>)

Implementations§

Source§

impl<'v> OwnedValue<'v>

Source

pub fn as_ref<'val>(&'val self) -> Value<'val, 'v>
where 'v: 'val,

Returns a Value as a reference to the OwnedValue

Trait Implementations§

Source§

impl<'ty> Clone for OwnedValue<'ty>

Source§

fn clone(&self) -> OwnedValue<'ty>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'ty> Debug for OwnedValue<'ty>

Source§

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

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

impl<'val, 'ty> From<OwnedValue<'ty>> for CowValue<'val, 'ty>

Source§

fn from(v: OwnedValue<'ty>) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<String> for OwnedValue<'ty>

Source§

fn from(val: String) -> OwnedValue<'ty>

Converts to this type from the input type.
Source§

impl<'ty> From<bool> for OwnedValue<'ty>

Source§

fn from(val: bool) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<f32> for OwnedValue<'ty>

Source§

fn from(val: f32) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<f64> for OwnedValue<'ty>

Source§

fn from(val: f64) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<i16> for OwnedValue<'ty>

Source§

fn from(val: i16) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<i32> for OwnedValue<'ty>

Source§

fn from(val: i32) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<i64> for OwnedValue<'ty>

Source§

fn from(val: i64) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<i8> for OwnedValue<'ty>

Source§

fn from(val: i8) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<u16> for OwnedValue<'ty>

Source§

fn from(val: u16) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<u32> for OwnedValue<'ty>

Source§

fn from(val: u32) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<u64> for OwnedValue<'ty>

Source§

fn from(val: u64) -> Self

Converts to this type from the input type.
Source§

impl<'ty> From<u8> for OwnedValue<'ty>

Source§

fn from(val: u8) -> Self

Converts to this type from the input type.
Source§

impl<'ty, T: Instance<'ty> + Typed<'ty> + 'ty> IntoInner<T> for OwnedValue<'ty>

Source§

impl<'val> IntoInner<bool> for OwnedValue<'val>

Source§

impl<'val> IntoInner<f32> for OwnedValue<'val>

Source§

impl<'val> IntoInner<f64> for OwnedValue<'val>

Source§

impl<'val> IntoInner<i16> for OwnedValue<'val>

Source§

impl<'val> IntoInner<i32> for OwnedValue<'val>

Source§

impl<'val> IntoInner<i64> for OwnedValue<'val>

Source§

impl<'val> IntoInner<i8> for OwnedValue<'val>

Source§

impl<'val> IntoInner<u16> for OwnedValue<'val>

Source§

impl<'val> IntoInner<u32> for OwnedValue<'val>

Source§

impl<'val> IntoInner<u64> for OwnedValue<'val>

Source§

impl<'val> IntoInner<u8> for OwnedValue<'val>

Source§

impl<'ty> PartialEq for OwnedValue<'ty>

Source§

fn eq(&self, other: &Self) -> 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.

Auto Trait Implementations§

§

impl<'ty> !Freeze for OwnedValue<'ty>

§

impl<'ty> !RefUnwindSafe for OwnedValue<'ty>

§

impl<'ty> Send for OwnedValue<'ty>

§

impl<'ty> Sync for OwnedValue<'ty>

§

impl<'ty> Unpin for OwnedValue<'ty>

§

impl<'ty> !UnwindSafe for OwnedValue<'ty>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.