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>
impl<'a> LuaTable<'a>
pub fn wrap(v: Variant) -> Result<Self, LuaError>
pub fn borrow(v: &'a Variant) -> Result<Self, LuaError>
pub fn borrowed<'s>(&'s self) -> Selfwhere
's: 'a,
pub fn owned(&self) -> LuaTable<'static>
pub fn as_variant(&self) -> &Variant
pub fn inner_ref(&self) -> Result<&'a Variant, &Variant>
pub fn inner_mut(&mut self) -> &mut Variant
pub fn into_variant(self) -> Variant
pub fn into_inner(self) -> Cow<'a, Variant>
source§impl<'v> LuaTable<'v>
impl<'v> LuaTable<'v>
pub fn into_lua_variant(self) -> LuaVariant<'v>
pub fn lua_variant(&self) -> LuaVariant<'_>
pub fn entry_len(&self) -> usize
pub fn is_empty(&self) -> bool
sourcepub fn table_getn(&self) -> Option<u64>
pub fn table_getn(&self) -> Option<u64>
Lua’s n
field, if it exists
pub fn variant_is_dict(&self) -> bool
pub fn iter_dict_entries<'a>( &'a self ) -> impl Iterator<Item = DictEntry<LuaVariant<'static>, LuaVariant<'static>>> + 'a
pub fn iter_array_indices<'a>( &'a self ) -> impl Iterator<Item = Option<u64>> + 'a
pub fn array_indices(&self) -> Vec<(usize, u64)>
pub fn iter_array_entries<'a>( &'a self ) -> impl Iterator<Item = (u64, LuaVariant<'static>)> + 'a
pub fn iter_array<'a>( &'a self ) -> impl Iterator<Item = Option<LuaVariant<'static>>> + 'a
pub fn array_len(&self) -> u64
pub fn key_at(&self, index: usize) -> Option<LuaVariant<'static>>
pub fn value_at(&self, index: usize) -> Option<LuaVariant<'static>>
pub fn by_key(&self, key: &LuaVariant<'_>) -> Option<LuaVariant<'static>>
pub fn is_array(&self) -> Option<bool>
pub fn is_vardict(&self) -> bool
pub fn into_vardict(self) -> Result<Self, LuaError>
Trait Implementations§
source§impl<'de, 'v> Deserialize<'de> for LuaTable<'v>
impl<'de, 'v> Deserialize<'de> for LuaTable<'v>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<LuaTable<'a>> for LuaVariant<'a>
impl<'a> From<LuaTable<'a>> for LuaVariant<'a>
source§impl<'v> From<LuaTable<'v>> for Deserializer<'v>
impl<'v> From<LuaTable<'v>> for Deserializer<'v>
source§impl<'a, 'v, K: StaticVariantType + Into<LuaVariant<'v>>, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<(K, V)> for LuaTable<'a>
impl<'a, 'v, K: StaticVariantType + Into<LuaVariant<'v>>, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<(K, V)> for LuaTable<'a>
source§impl<'a, 'v, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<V> for LuaTable<'a>
impl<'a, 'v, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<V> for LuaTable<'a>
source§fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self
Creates a value from an iterator. Read more
source§impl<'a> FromVariant for LuaTable<'a>
impl<'a> FromVariant for LuaTable<'a>
source§impl<'a, 'de, 'v> IntoDeserializer<'de, LuaError> for &'a LuaTable<'v>
impl<'a, 'de, 'v> IntoDeserializer<'de, LuaError> for &'a LuaTable<'v>
§type Deserializer = Deserializer<'v>
type Deserializer = Deserializer<'v>
The type of the deserializer being converted into.
source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
source§impl<'de, 'v> IntoDeserializer<'de, LuaError> for LuaTable<'v>
impl<'de, 'v> IntoDeserializer<'de, LuaError> for LuaTable<'v>
§type Deserializer = Deserializer<'v>
type Deserializer = Deserializer<'v>
The type of the deserializer being converted into.
source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
source§impl<'a, T: AsRef<Variant>> PartialOrd<T> for LuaTable<'a>
impl<'a, T: AsRef<Variant>> PartialOrd<T> for LuaTable<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl StaticVariantType for LuaTable<'_>
impl StaticVariantType for LuaTable<'_>
source§fn static_variant_type() -> Cow<'static, VariantTy>
fn static_variant_type() -> Cow<'static, VariantTy>
Returns the
VariantType
corresponding to Self
.source§impl<'a> ToVariant for LuaTable<'a>
impl<'a> ToVariant for LuaTable<'a>
source§fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
Returns a
Variant
clone of self
.source§impl<'a> TryFrom<LuaVariant<'a>> for LuaTable<'a>
impl<'a> TryFrom<LuaVariant<'a>> for LuaTable<'a>
source§impl<'a> UnsafeFrom<&'a Variant> for LuaTable<'a>
impl<'a> UnsafeFrom<&'a Variant> for LuaTable<'a>
source§unsafe fn unsafe_from(v: &'a Variant) -> Self
unsafe fn unsafe_from(v: &'a Variant) -> Self
Safety Read more
source§impl<'a> UnsafeFrom<LuaVariant<'a>> for LuaTable<'a>
impl<'a> UnsafeFrom<LuaVariant<'a>> for LuaTable<'a>
source§unsafe fn unsafe_from(v: LuaVariant<'a>) -> Self
unsafe fn unsafe_from(v: LuaVariant<'a>) -> Self
Safety Read more
source§impl<'a> UnsafeFrom<Variant> for LuaTable<'a>
impl<'a> UnsafeFrom<Variant> for LuaTable<'a>
source§unsafe fn unsafe_from(v: Variant) -> Self
unsafe fn unsafe_from(v: Variant) -> Self
Safety Read more
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more