DartValue

Enum DartValue 

Source
#[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 Debug for DartValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for DartValue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<()> for DartValue

Source§

fn from((): ()) -> Self

Converts to this type from the input type.
Source§

impl From<*mut _Dart_Handle> for DartValue

Source§

fn from(handle: Dart_Handle) -> Self

Converts to this type from the input type.
Source§

impl From<DartError> for DartValue

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<MediaDirection> for DartValue

Source§

fn from(val: MediaDirection) -> Self

Converts to this type from the input type.
Source§

impl From<NonNull<*mut _Dart_Handle>> for DartValue

Source§

fn from(handle: NonNull<*mut _Dart_Handle>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<*mut _Dart_Handle>> for DartValue

Source§

fn from(val: Option<Dart_Handle>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<DartError>> for DartValue

Source§

fn from(val: Option<Error>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<NonNull<*mut _Dart_Handle>>> for DartValue

Source§

fn from(val: Option<NonNull<Dart_Handle>>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<String>> for DartValue

Source§

fn from(val: Option<String>) -> Self

Converts to this type from the input type.
Source§

impl<T: ForeignClass> From<Option<T>> for DartValue

Source§

fn from(val: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl From<Option<i64>> for DartValue

Source§

fn from(val: Option<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for DartValue

Source§

fn from(string: String) -> Self

Converts to this type from the input type.
Source§

impl<T: ForeignClass> From<T> for DartValue

Source§

fn from(val: T) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for DartValue

Source§

fn from(val: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for DartValue

Source§

fn from(val: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for DartValue

Source§

fn from(val: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for DartValue

Source§

fn from(val: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for DartValue

Source§

fn from(val: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for DartValue

Source§

fn from(val: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for DartValue

Source§

fn from(val: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for DartValue

Source§

fn from(val: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for DartValue

Source§

fn from(val: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for DartValue

Source§

fn from(val: u8) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<E> WrapTraced<E> for E

Source§

fn wrap_traced(self, f: Frame) -> Traced<E>

Wraps this error into a Traced wrapper, storing the given Frame of a Trace inside.
Source§

impl<T> DartSafe for T

Source§

impl<T> ErasedDestructor for T
where T: 'static,