[]Trait dart::dart_handle::DartHandle

pub unsafe trait DartHandle: 'static + Sized {
    fn handle(&self) -> Dart_Handle;
fn safe_handle(&self) -> UnverifiedDartHandle;
fn from_handle(
        handle: UnverifiedDartHandle
    ) -> Result<Self, UnverifiedDartHandle>; }

Describes a smart wrapper around a dart handle. This is effectively a "Has a Dart_Handle" trait.

Safety

When implementing this trait:

  • It is assumed that calls to handle, safe_handle, and from_handle will not modify the handles being used in any way, shape or form.
  • It is assumed that calls to any of the functions with the same parameters will always return the same value.
  • It is assumed that this object does not take care of disposal of the handle, and instead leaves that up to the VM to take care of.

Required methods

fn handle(&self) -> Dart_Handle

Gets the raw handle from a smart wrapper.

fn safe_handle(&self) -> UnverifiedDartHandle

Gets the smart handle from a smart wrapper.

fn from_handle(
    handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>

Creates a smart wrapper from a smart handle.

It is assumed that when calling this function with a smart handle, it will return an Err with the handle should it not be the correct handle type.

Loading content...

Implementations on Foreign Types

impl DartHandle for Result<UnverifiedDartHandle, Error>[src]

Loading content...

Implementors

impl DartHandle for Error[src]

impl DartHandle for UnverifiedDartHandle[src]

impl DartHandle for Boolean[src]

impl DartHandle for DString

impl DartHandle for Double

impl DartHandle for Dynamic

impl DartHandle for Integer

impl<T: 'static> DartHandle for List<T>

Loading content...