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 as3::null, depending on the API behavior.
In such cases, as3::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 fn new( _: &CurrentContext<'a>, class: UCStr, args: Option<&[Object<'a>]>, ) -> 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 as3::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 expected to be refactored if the ANE C API allows more precise determination of an object’s concrete type.
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 as3::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 expected to be refactored if the ANE C API allows more precise determination of an object’s concrete type.