[−]Trait dart::dart_handle::DartHandle
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
, andfrom_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>
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.
Implementations on Foreign Types
impl DartHandle for Result<UnverifiedDartHandle, Error>
[src]
fn handle(&self) -> Dart_Handle
[src]
fn safe_handle(&self) -> UnverifiedDartHandle
[src]
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
[src]
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
Implementors
impl DartHandle for Error
[src]
fn handle(&self) -> Dart_Handle
[src]
fn safe_handle(&self) -> UnverifiedDartHandle
[src]
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
[src]
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
impl DartHandle for UnverifiedDartHandle
[src]
fn handle(&self) -> Dart_Handle
[src]
fn safe_handle(&self) -> Self
[src]
fn from_handle(handle: Self) -> Result<Self, Self>
[src]
impl DartHandle for Boolean
[src]
fn handle(&self) -> Dart_Handle
[src]
fn safe_handle(&self) -> UnverifiedDartHandle
[src]
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
[src]
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
impl DartHandle for DString
fn handle(&self) -> Dart_Handle
fn safe_handle(&self) -> UnverifiedDartHandle
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
impl DartHandle for Double
fn handle(&self) -> Dart_Handle
fn safe_handle(&self) -> UnverifiedDartHandle
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
impl DartHandle for Dynamic
fn handle(&self) -> Dart_Handle
fn safe_handle(&self) -> UnverifiedDartHandle
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
impl DartHandle for Integer
fn handle(&self) -> Dart_Handle
fn safe_handle(&self) -> UnverifiedDartHandle
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
impl<T: 'static> DartHandle for List<T>
fn handle(&self) -> Dart_Handle
fn safe_handle(&self) -> UnverifiedDartHandle
fn from_handle(
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>
handle: UnverifiedDartHandle
) -> Result<Self, UnverifiedDartHandle>