Struct wireplumber::lua::LuaTable

source ·
pub struct LuaTable<'a>(/* private fields */);
Available on crate feature lua only.
Expand description

A specialized LuaVariant that is both an array and dictionary.

Implementations§

source§

impl<'a> LuaTable<'a>

source

pub fn wrap(v: Variant) -> Result<Self, LuaError>

source

pub fn borrow(v: &'a Variant) -> Result<Self, LuaError>

source

pub fn borrowed<'s>(&'s self) -> Self
where 's: 'a,

source

pub fn owned(&self) -> LuaTable<'static>

source

pub fn as_variant(&self) -> &Variant

source

pub fn inner_ref(&self) -> Result<&'a Variant, &Variant>

source

pub fn inner_mut(&mut self) -> &mut Variant

source

pub fn into_variant(self) -> Variant

source

pub fn into_inner(self) -> Cow<'a, Variant>

source§

impl<'v> LuaTable<'v>

source

pub fn into_lua_variant(self) -> LuaVariant<'v>

source

pub fn lua_variant(&self) -> LuaVariant<'_>

source

pub fn entry_len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn table_getn(&self) -> Option<u64>

Lua’s n field, if it exists

source

pub fn variant_is_dict(&self) -> bool

source

pub fn iter_dict_entries<'a>( &'a self ) -> impl Iterator<Item = DictEntry<LuaVariant<'static>, LuaVariant<'static>>> + 'a

source

pub fn iter_array_indices<'a>( &'a self ) -> impl Iterator<Item = Option<u64>> + 'a

source

pub fn array_indices(&self) -> Vec<(usize, u64)>

source

pub fn iter_array_entries<'a>( &'a self ) -> impl Iterator<Item = (u64, LuaVariant<'static>)> + 'a

source

pub fn iter_array<'a>( &'a self ) -> impl Iterator<Item = Option<LuaVariant<'static>>> + 'a

source

pub fn array_len(&self) -> u64

source

pub fn key_at(&self, index: usize) -> Option<LuaVariant<'static>>

source

pub fn value_at(&self, index: usize) -> Option<LuaVariant<'static>>

source

pub fn by_key(&self, key: &LuaVariant<'_>) -> Option<LuaVariant<'static>>

source

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

source

pub fn is_vardict(&self) -> bool

source

pub fn into_vardict(self) -> Result<Self, LuaError>

Trait Implementations§

source§

impl<'a> AsRef<Variant> for LuaTable<'a>

source§

fn as_ref(&self) -> &Variant

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> Clone for LuaTable<'a>

source§

fn clone(&self) -> LuaTable<'a>

Returns a copy 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<'a> Debug for LuaTable<'a>

source§

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

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

impl<'de, 'v> Deserialize<'de> for LuaTable<'v>

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> Display for LuaTable<'a>

source§

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

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

impl<'a> From<LuaTable<'a>> for LuaVariant<'a>

source§

fn from(v: LuaTable<'a>) -> Self

Converts to this type from the input type.
source§

impl<'v> From<LuaTable<'v>> for Deserializer<'v>

source§

fn from(v: LuaTable<'v>) -> Self

Converts to this type from the input type.
source§

impl<'a, 'v, K: StaticVariantType + Into<LuaVariant<'v>>, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<(K, V)> for LuaTable<'a>

source§

fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<'a, 'v, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<V> for LuaTable<'a>

source§

fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<'a> FromStr for LuaTable<'a>

§

type Err = <Variant as FromStr>::Err

The associated error which can be returned from parsing.
source§

fn from_str(str: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl<'a> FromVariant for LuaTable<'a>

source§

fn from_variant(variant: &Variant) -> Option<Self>

Tries to extract a value. Read more
source§

impl<'a> Hash for LuaTable<'a>

source§

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

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> Into<Cow<'a, Variant>> for LuaTable<'a>

source§

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

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

impl<'a> Into<Variant> for LuaTable<'a>

source§

fn into(self) -> Variant

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

impl<'a, 'de, 'v> IntoDeserializer<'de, LuaError> for &'a LuaTable<'v>

§

type Deserializer = Deserializer<'v>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.
source§

impl<'de, 'v> IntoDeserializer<'de, LuaError> for LuaTable<'v>

§

type Deserializer = Deserializer<'v>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.
source§

impl<'a, T: AsRef<Variant>> PartialEq<T> for LuaTable<'a>

source§

fn eq(&self, rhs: &T) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a, T: AsRef<Variant>> PartialOrd<T> for LuaTable<'a>

source§

fn partial_cmp(&self, rhs: &T) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'v> Serialize for LuaTable<'v>

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl StaticVariantType for LuaTable<'_>

source§

fn static_variant_type() -> Cow<'static, VariantTy>

Returns the VariantType corresponding to Self.
source§

impl<'a> ToVariant for LuaTable<'a>

source§

fn to_variant(&self) -> Variant

Returns a Variant clone of self.
source§

impl<'a> TryFrom<&'a Variant> for LuaTable<'a>

§

type Error = LuaError

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

fn try_from(v: &'a Variant) -> Result<Self, LuaError>

Performs the conversion.
source§

impl<'a> TryFrom<Cow<'a, Variant>> for LuaTable<'a>

§

type Error = LuaError

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

fn try_from(v: Cow<'a, Variant>) -> Result<Self, LuaError>

Performs the conversion.
source§

impl<'a> TryFrom<LuaVariant<'a>> for LuaTable<'a>

§

type Error = LuaError

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

fn try_from(v: LuaVariant<'a>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<Variant> for LuaTable<'a>

§

type Error = LuaError

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

fn try_from(v: Variant) -> Result<Self, LuaError>

Performs the conversion.
source§

impl<'a> UnsafeFrom<&'a Variant> for LuaTable<'a>

source§

unsafe fn unsafe_from(v: &'a Variant) -> Self

Safety Read more
source§

impl<'a> UnsafeFrom<Cow<'a, Variant>> for LuaTable<'a>

source§

unsafe fn unsafe_from(v: Cow<'a, Variant>) -> Self

Safety Read more
source§

impl<'a> UnsafeFrom<LuaVariant<'a>> for LuaTable<'a>

source§

unsafe fn unsafe_from(v: LuaVariant<'a>) -> Self

Safety Read more
source§

impl<'a> UnsafeFrom<Variant> for LuaTable<'a>

source§

unsafe fn unsafe_from(v: Variant) -> Self

Safety Read more
source§

impl<'a> Eq for LuaTable<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for LuaTable<'a>

§

impl<'a> RefUnwindSafe for LuaTable<'a>

§

impl<'a> Send for LuaTable<'a>

§

impl<'a> Sync for LuaTable<'a>

§

impl<'a> Unpin for LuaTable<'a>

§

impl<'a> UnwindSafe for LuaTable<'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> ToLuaTable for T
where T: TryInto<LuaTable<'static>>, <T as TryInto<LuaTable<'static>>>::Error: Into<LuaError>,

source§

fn to_lua_variant(self) -> Result<Option<LuaTable<'static>>, LuaError>

Available on crate feature lua only.
source§

impl<T> ToOwned for T
where T: Clone,

§

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> ToString for T
where T: Display + ?Sized,

source§

default 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>,

§

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>,

§

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,