[]Struct dart::dart_native_arguments::NativeArguments

#[repr(transparent)]pub struct NativeArguments { /* fields omitted */ }

Native arguments passed to a standard dart native extension function.

Manages arguments going in, and also return values going out.

Methods

impl NativeArguments[src]

pub unsafe fn new(args: Dart_NativeArguments) -> Self[src]

Creates a new NativeArguments from a value given by the VM.

Safety

args must be a pointer to a valid instance of Dart_NativeArguments. Not doing so will cause UB as the VM tries to dereference the pointer.

pub fn get_native_arguments(
    &self
) -> Result<(Vec<Dart_NativeArgument_Descriptor>, Vec<Dart_NativeArgument_Value>), Error>
[src]

Extracts the native arguments of the function call. This will return both the type and value of each argument. The two returned Vecs should theoretically have the same length.

pub fn get_native_argument_count(&self) -> usize[src]

Acquires the number of arguments in the NativeArguments.

pub fn get_native_argument(&self, idx: usize) -> UnverifiedDartHandle[src]

Acquires a single argument by instance in the NativeArguments. This may be an error handle. It is your job to reassure that it isn't by calling .get_error().

pub fn get_string_arg(&self, idx: usize) -> Result<String, Error>[src]

Attempts to retrieve a string from the argument list, returning an error should it not be a string.

pub fn get_bool_arg(&self, idx: usize) -> Result<bool, Error>[src]

Attempts to retrieve a boolean from the argument list, returning an error should it not be a boolean.

pub fn get_i64_arg(&self, idx: usize) -> Result<i64, Error>[src]

Attempts to get a 64 bit signed integer from the argument list, returning an error should it not be an integer.

pub fn get_f64_arg(&self, idx: usize) -> Result<f64, Error>[src]

Attempts to get a 64 bit floating point value from the argument list, returning an error should it not be an f64.

pub fn set_return(&self, val: UnverifiedDartHandle)[src]

Sets an instance as the return value. This (and associated set_*_return functions) will be what is received on the dart end after calling the function.

pub fn set_bool_return(&self, val: bool)[src]

Sets a boolean return value. See set_return for more information.

pub fn set_i64_return(&self, val: i64)[src]

Sets an integer return value. See set_return for more information.

pub fn set_f64_return(&self, val: f64)[src]

Sets a floating point return value. See set_return for more information.

Auto Trait Implementations

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, 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.