pub struct Object<'a>(/* private fields */);Expand description
A wrapper around FREObject.
This type assumes that the underlying handle is always valid. The runtime is responsible for ensuring the correctness and lifetime of the handle.
Note that the handle may still be null, depending on the API behavior.
In such cases, null is treated as a valid value at the ABI level,
but may represent the absence of an object.
Implementations§
Source§impl<'a> Object<'a>
impl<'a> Object<'a>
pub const NULL: Object<'static>
pub fn new( frt: &FlashRuntime<'a>, class: UCStr, args: Option<&[Object<'_>]>, ) -> Result<Object<'a>, ExternalError<'a>>
Sourcepub fn with_native_window<F, R>(self, f: F) -> Result<R, FfiError>
pub fn with_native_window<F, R>(self, f: F) -> Result<R, FfiError>
FRENativeWindow is only valid for the duration of this closure call.
Using null inside the closure is meaningless and may lead to unintended FFI call ordering.
This is a minimal safety wrapper around the underlying FFI. Its current placement, shape, and usage are not ideal, and it is hoped that it can be refactored if a more flexible C API becomes available in the AIR SDK.
Sourcepub fn with_native_window_3d<F, R>(self, f: F) -> Result<R, ExternalError<'a>>
pub fn with_native_window_3d<F, R>(self, f: F) -> Result<R, ExternalError<'a>>
Using null inside the closure is meaningless and may lead to unintended FFI call ordering.
This is a minimal safety wrapper around the underlying FFI. Its current placement, shape, and usage are not ideal, and it is hoped that it can be refactored if a more flexible C API becomes available in the AIR SDK.
Trait Implementations§
Source§impl<'a> AsObject<'a> for Object<'a>
impl<'a> AsObject<'a> for Object<'a>
const TYPE: Type = Type::Object
fn as_object(self) -> Object<'a>
fn as_ptr(self) -> FREObject
fn is_null(self) -> bool
fn get_type(self) -> Type
fn get_property(self, name: UCStr) -> Result<Object<'a>, ExternalError<'a>>
fn set_property<O: AsObject<'a>>( self, name: UCStr, value: O, ) -> Result<(), ExternalError<'a>>
fn call_method( self, name: UCStr, args: Option<&[Object<'_>]>, ) -> Result<Object<'a>, ExternalError<'a>>
Source§fn toString(self) -> Result<StringObject<'a>, ExternalError<'a>>
fn toString(self) -> Result<StringObject<'a>, ExternalError<'a>>
Source§impl<'a> From<BitmapData<'a>> for Object<'a>
impl<'a> From<BitmapData<'a>> for Object<'a>
Source§fn from(value: BitmapData<'a>) -> Self
fn from(value: BitmapData<'a>) -> Self
Source§impl<'a> From<ErrorObject<'a>> for Object<'a>
impl<'a> From<ErrorObject<'a>> for Object<'a>
Source§fn from(value: ErrorObject<'a>) -> Self
fn from(value: ErrorObject<'a>) -> Self
Source§impl<'a> From<StringObject<'a>> for Object<'a>
impl<'a> From<StringObject<'a>> for Object<'a>
Source§fn from(value: StringObject<'a>) -> Self
fn from(value: StringObject<'a>) -> Self
Source§impl<'a> TryFrom<Object<'a>> for BitmapData<'a>
impl<'a> TryFrom<Object<'a>> for BitmapData<'a>
Source§impl<'a> TryFrom<Object<'a>> for Context<'a>
impl<'a> TryFrom<Object<'a>> for Context<'a>
The returned Context must be used with caution. It is derived from external state,
and its associated data may be unknown and not managed by this crate. As a result,
the underlying memory may become invalid or outlive its expected lifetime.
This is a minimal safety wrapper around the underlying FFI. Its current placement, shape, and usage are not ideal, and it is hoped that it can be refactored if a more flexible C API becomes available in the AIR SDK.