Struct wireplumber::lua::LuaVariant
source · pub struct LuaVariant<'a>(/* private fields */);
Available on crate feature
lua
only.Expand description
A Variant that can be passed to a Lua script.
LuaVariant
serves as a sort of adhoc ABI for WirePlumber modules
and their configuration data.
Implementations§
source§impl<'a> LuaVariant<'a>
impl<'a> LuaVariant<'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) -> LuaVariant<'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> LuaVariant<'v>
impl<'v> LuaVariant<'v>
pub fn nil() -> Self
pub fn convert_from(v: &Variant) -> Result<Self, LuaError>
pub fn with_bytes<B: AsRef<[u8]>>(bytes: B) -> Self
pub fn lua_type(&self) -> LuaType
pub fn lua_value(&self) -> LuaValue<'_>
pub fn flattened(&self) -> Self
pub fn get_nil<'a>(&'a self) -> Option<()>
pub fn get_bool<'a>(&'a self) -> Option<bool>
pub fn get_table<'a>(&'a self) -> Option<LuaTable<'a>>
pub fn get_string(&self) -> Option<LuaString<'_>>
pub fn get_float(&self) -> Option<Result<f64, LuaError>>
pub fn get_integer<T>(&self) -> Option<Result<T, LuaError>>where
T: TryFrom<bool> + TryFrom<u8> + TryFrom<u16> + TryFrom<u32> + TryFrom<u64> + TryFrom<i16> + TryFrom<i32> + TryFrom<i64>,
<T as TryFrom<bool>>::Error: Into<LuaError>,
<T as TryFrom<u8>>::Error: Into<LuaError>,
<T as TryFrom<u16>>::Error: Into<LuaError>,
<T as TryFrom<u32>>::Error: Into<LuaError>,
<T as TryFrom<u64>>::Error: Into<LuaError>,
<T as TryFrom<i16>>::Error: Into<LuaError>,
<T as TryFrom<i32>>::Error: Into<LuaError>,
<T as TryFrom<i64>>::Error: Into<LuaError>,
Trait Implementations§
source§impl<'a> AsRef<Variant> for LuaVariant<'a>
impl<'a> AsRef<Variant> for LuaVariant<'a>
source§impl<'a> Clone for LuaVariant<'a>
impl<'a> Clone for LuaVariant<'a>
source§fn clone(&self) -> LuaVariant<'a>
fn clone(&self) -> LuaVariant<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for LuaVariant<'a>
impl<'a> Debug for LuaVariant<'a>
source§impl<'de, 'v> Deserialize<'de> for LuaVariant<'v>
impl<'de, 'v> Deserialize<'de> for LuaVariant<'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> Display for LuaVariant<'a>
impl<'a> Display for LuaVariant<'a>
source§impl<'a> From<()> for LuaVariant<'a>
impl<'a> From<()> for LuaVariant<'a>
source§impl<'a> From<LuaTable<'a>> for LuaVariant<'a>
impl<'a> From<LuaTable<'a>> for LuaVariant<'a>
source§impl<'v> From<LuaVariant<'v>> for Deserializer<'v>
impl<'v> From<LuaVariant<'v>> for Deserializer<'v>
source§fn from(v: LuaVariant<'v>) -> Self
fn from(v: LuaVariant<'v>) -> Self
Converts to this type from the input type.
source§impl<'a> From<bool> for LuaVariant<'a>
impl<'a> From<bool> for LuaVariant<'a>
source§impl<'a> From<f64> for LuaVariant<'a>
impl<'a> From<f64> for LuaVariant<'a>
source§impl<'a> From<i16> for LuaVariant<'a>
impl<'a> From<i16> for LuaVariant<'a>
source§impl<'a> From<i32> for LuaVariant<'a>
impl<'a> From<i32> for LuaVariant<'a>
source§impl<'a> From<i64> for LuaVariant<'a>
impl<'a> From<i64> for LuaVariant<'a>
source§impl<'a> From<u16> for LuaVariant<'a>
impl<'a> From<u16> for LuaVariant<'a>
source§impl<'a> From<u32> for LuaVariant<'a>
impl<'a> From<u32> for LuaVariant<'a>
source§impl<'a> From<u64> for LuaVariant<'a>
impl<'a> From<u64> for LuaVariant<'a>
source§impl<'a, 'v, K: StaticVariantType + Into<LuaVariant<'v>>, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<(K, V)> for LuaVariant<'a>
impl<'a, 'v, K: StaticVariantType + Into<LuaVariant<'v>>, V: StaticVariantType + Into<LuaVariant<'v>>> FromIterator<(K, V)> for LuaVariant<'a>
source§impl<'a, 'v> FromIterator<LuaVariant<'v>> for LuaVariant<'a>
impl<'a, 'v> FromIterator<LuaVariant<'v>> for LuaVariant<'a>
source§fn from_iter<T: IntoIterator<Item = LuaVariant<'v>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = LuaVariant<'v>>>(iter: T) -> Self
Creates a value from an iterator. Read more
source§impl<'a> FromStr for LuaVariant<'a>
impl<'a> FromStr for LuaVariant<'a>
source§impl<'a> FromVariant for LuaVariant<'a>
impl<'a> FromVariant for LuaVariant<'a>
source§impl<'a> Hash for LuaVariant<'a>
impl<'a> Hash for LuaVariant<'a>
source§impl<'a> Into<Variant> for LuaVariant<'a>
impl<'a> Into<Variant> for LuaVariant<'a>
source§impl<'a, 'de, 'v> IntoDeserializer<'de, LuaError> for &'a LuaVariant<'v>
impl<'a, 'de, 'v> IntoDeserializer<'de, LuaError> for &'a LuaVariant<'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 LuaVariant<'v>
impl<'de, 'v> IntoDeserializer<'de, LuaError> for LuaVariant<'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 LuaVariant<'a>
impl<'a, T: AsRef<Variant>> PartialOrd<T> for LuaVariant<'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<'v> Serialize for LuaVariant<'v>
impl<'v> Serialize for LuaVariant<'v>
source§impl<'a> StaticVariantType for LuaVariant<'a>
impl<'a> StaticVariantType for LuaVariant<'a>
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 LuaVariant<'a>
impl<'a> ToVariant for LuaVariant<'a>
source§fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
Returns a
Variant
clone of self
.source§impl<'a> TryFrom<&'a Variant> for LuaVariant<'a>
impl<'a> TryFrom<&'a Variant> for LuaVariant<'a>
source§impl<'a> TryFrom<LuaVariant<'a>> for LuaTable<'a>
impl<'a> TryFrom<LuaVariant<'a>> for LuaTable<'a>
source§impl<'a> TryFrom<Variant> for LuaVariant<'a>
impl<'a> TryFrom<Variant> for LuaVariant<'a>
source§impl<'a> UnsafeFrom<&'a Variant> for LuaVariant<'a>
impl<'a> UnsafeFrom<&'a Variant> for LuaVariant<'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<Cow<'a, Variant>> for LuaVariant<'a>
impl<'a> UnsafeFrom<Cow<'a, Variant>> for LuaVariant<'a>
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 LuaVariant<'a>
impl<'a> UnsafeFrom<Variant> for LuaVariant<'a>
source§unsafe fn unsafe_from(v: Variant) -> Self
unsafe fn unsafe_from(v: Variant) -> Self
Safety Read more
impl<'a> Eq for LuaVariant<'a>
Auto Trait Implementations§
impl<'a> Freeze for LuaVariant<'a>
impl<'a> RefUnwindSafe for LuaVariant<'a>
impl<'a> Send for LuaVariant<'a>
impl<'a> Sync for LuaVariant<'a>
impl<'a> Unpin for LuaVariant<'a>
impl<'a> UnwindSafe for LuaVariant<'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