pub struct NativeSession { /* private fields */ }Expand description
Owns an embedded composition and its worker thread.
Platform CranposeView adapters drive this session automatically. An application
creates one with NativeSession::new and supplies only its content and events.
Implementations§
Source§impl NativeSession
impl NativeSession
Source§impl NativeSession
impl NativeSession
Sourcepub fn set_listener(
&self,
listener: Box<dyn FrameListener>,
) -> Result<(), NativeError>
pub fn set_listener( &self, listener: Box<dyn FrameListener>, ) -> Result<(), NativeError>
Attaches the platform frame callback and requests an initial frame.
Sourcepub async fn frame(
&self,
width: u32,
height: u32,
density: f32,
) -> Result<NativeFrame, NativeError>
pub async fn frame( &self, width: u32, height: u32, density: f32, ) -> Result<NativeFrame, NativeError>
Produces the next presentation update. Platform adapters serialize these calls.
Sourcepub fn send_event(&self, name: String, value: String) -> Result<(), NativeError>
pub fn send_event(&self, name: String, value: String) -> Result<(), NativeError>
Delivers application input without exposing rendering internals.
Sourcepub fn touch(
&self,
phase: TouchPhase,
x: f32,
y: f32,
) -> Result<(), NativeError>
pub fn touch( &self, phase: TouchPhase, x: f32, y: f32, ) -> Result<(), NativeError>
Routes a pointer event in logical points.
Sourcepub fn native_event(&self, id: u64, event: String) -> Result<(), NativeError>
pub fn native_event(&self, id: u64, event: String) -> Result<(), NativeError>
Routes a factory event from a mounted native child; stale IDs are ignored.
Sourcepub fn set_visible(&self, visible: bool) -> Result<(), NativeError>
pub fn set_visible(&self, visible: bool) -> Result<(), NativeError>
Suspends hidden or detached content and resumes it when visible.
Trait Implementations§
Source§impl Drop for NativeSession
impl Drop for NativeSession
Source§impl<UT> LiftRef<UT> for NativeSession
impl<UT> LiftRef<UT> for NativeSession
type LiftType = Arc<NativeSession>
Source§impl<UT> LowerError<UT> for NativeSession
impl<UT> LowerError<UT> for NativeSession
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for NativeSession
impl<UT> LowerReturn<UT> for NativeSession
Source§type ReturnType = <Arc<NativeSession> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<NativeSession> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl<UT> TypeId<UT> for NativeSession
impl<UT> TypeId<UT> for NativeSession
Auto Trait Implementations§
impl !Freeze for NativeSession
impl RefUnwindSafe for NativeSession
impl Send for NativeSession
impl Sync for NativeSession
impl Unpin for NativeSession
impl UnsafeUnpin for NativeSession
impl UnwindSafe for NativeSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more