#[repr(C)]pub enum Val {
Int(c_int),
Double(c_double),
String(*const c_uchar, size_t),
Uint(c_uint),
}Expand description
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§
Implementations§
Source§impl Val
impl Val
Sourcepub fn to_value(&self) -> Result<Value, ValueConversionError>
pub fn to_value(&self) -> Result<Value, ValueConversionError>
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 StructuralPartialEq for Val
Auto Trait Implementations§
impl Freeze for Val
impl RefUnwindSafe for Val
impl !Send for Val
impl !Sync for Val
impl Unpin for Val
impl UnwindSafe for Val
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