[][src]Enum kpal_plugin::Val

#[repr(C)]
pub enum Val {
    Int(c_int),
    Double(c_double),
    String(*const c_ucharsize_t),
    Uint(c_uint),
}

A wrapper type for transporting Values through the plugin API.

Unlike the Value enum, this type is intended to be sent through the FFI. Because of this, the enum variants can only contain C-compatible datatypes.

Variants

Int(c_int)
Double(c_double)
Uint(c_uint)

Methods

impl Val[src]

pub fn to_value(&self) -> Result<Value, ValueConversionError>[src]

Clones the data inside a Val into a new Value type.

This method is used to convert Vals, which pass through the FFI, into owned Value datatypes. Wrapped data that is not Copy is necessarily cloned when the new Value instance is created.

Trait Implementations

impl Clone for Val[src]

impl Debug for Val[src]

impl PartialEq<Val> for Val[src]

impl StructuralPartialEq for Val[src]

Auto Trait Implementations

impl RefUnwindSafe for Val

impl !Send for Val

impl !Sync for Val

impl Unpin for Val

impl UnwindSafe for Val

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.