Skip to main content

ValueRef

Enum ValueRef 

Source
pub enum ValueRef<'a> {
    Borrowed(Ref<'a, Value>),
    Owned(Value),
}

Variants§

§

Borrowed(Ref<'a, Value>)

§

Owned(Value)

Implementations§

Source§

impl<'a> ValueRef<'a>

Source

pub fn as_value(&self) -> &Value

Source

pub fn to_owned(&self) -> Value

Source

pub fn into_owned(self) -> Value

Source

pub fn as_bool(&self) -> Option<bool>

Source

pub fn as_int(&self) -> Option<LustInt>

Source

pub fn as_float(&self) -> Option<LustFloat>

Source

pub fn as_string(&self) -> Option<&str>

Source

pub fn as_rc_string(&self) -> Option<Rc<String>>

Source

pub fn as_array_handle(&self) -> Option<ArrayHandle>

Source

pub fn as_map_handle(&self) -> Option<MapHandle>

Source

pub fn as_struct_handle(&self) -> Option<StructHandle>

Trait Implementations§

Source§

impl<'a> FromStructField<'a> for ValueRef<'a>

Source§

fn from_value(_field: &str, value: ValueRef<'a>) -> Result<Self>

Auto Trait Implementations§

§

impl<'a> Freeze for ValueRef<'a>

§

impl<'a> !RefUnwindSafe for ValueRef<'a>

§

impl<'a> !Send for ValueRef<'a>

§

impl<'a> !Sync for ValueRef<'a>

§

impl<'a> Unpin for ValueRef<'a>

§

impl<'a> UnsafeUnpin for ValueRef<'a>

§

impl<'a> !UnwindSafe for ValueRef<'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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V