#[repr(C, u8)]pub enum DartValue {
None,
Ptr(NonNull<c_void>),
Handle(NonNull<Dart_Handle>),
String(NonNull<c_char>, MemoryOwner),
Int(i64),
Float(f64),
Bool(bool),
}Expand description
Type-erased value that can be transferred via FFI boundaries to/from Dart.
Variants§
None
No value. It can mean (), void or Option::None basing on the
contexts.
Ptr(NonNull<c_void>)
Pointer to a Boxed Rust object.
Handle(NonNull<Dart_Handle>)
Pointer to a Dart_Handle of some Dart object.
String(NonNull<c_char>, MemoryOwner)
Native string.
Int(i64)
Integer value.
This can also be used to transfer boolean values and C-like enums.
Float(f64)
Float value.
Bool(bool)
Boolean value.
Trait Implementations§
Source§impl From<*mut _Dart_Handle> for DartValue
impl From<*mut _Dart_Handle> for DartValue
Source§fn from(handle: Dart_Handle) -> Self
fn from(handle: Dart_Handle) -> Self
Converts to this type from the input type.
Source§impl From<MediaDirection> for DartValue
impl From<MediaDirection> for DartValue
Source§fn from(val: MediaDirection) -> Self
fn from(val: MediaDirection) -> Self
Converts to this type from the input type.
Source§impl From<Option<*mut _Dart_Handle>> for DartValue
impl From<Option<*mut _Dart_Handle>> for DartValue
Source§fn from(val: Option<Dart_Handle>) -> Self
fn from(val: Option<Dart_Handle>) -> Self
Converts to this type from the input type.
Source§impl<T: ForeignClass> From<T> for DartValue
impl<T: ForeignClass> From<T> for DartValue
Auto Trait Implementations§
impl Freeze for DartValue
impl RefUnwindSafe for DartValue
impl !Send for DartValue
impl !Sync for DartValue
impl Unpin for DartValue
impl UnwindSafe for DartValue
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