Skip to main content

VeloxEmbedSession

Struct VeloxEmbedSession 

Source
pub struct VeloxEmbedSession {
    pub engine: VeloxEngine,
    /* private fields */
}
Expand description

单个可多实例并行的宿主嵌入会话(统一承载 VeloxEngine + GPU 共享导出器或软件缓冲回退)。

Fields§

§engine: VeloxEngine

Implementations§

Source§

impl VeloxEmbedSession

Source

pub fn new<V: View>( root_view: V, logical_width: i16, logical_height: i16, scale_factor: f32, config: VeloxHostAdapterConfig, ) -> Self

创建一个挂载指定根视图的跨框架嵌入会话。

Source

pub fn backend_is_gpu(&self) -> bool

返回当前会话是否激活了 GPU 硬件共享导出后端。

Source

pub fn gpu_exporter_mut(&mut self) -> Option<&mut WgpuSharedExportRenderer>

返回底层 GPU 共享导出器可变引用(供 Rust 宿主直接注册外部零拷贝纹理或检查句柄)。

Source

pub fn resize( &mut self, logical_width: i16, logical_height: i16, scale_factor: f32, )

调整嵌入视口的逻辑尺寸与缩放因子。

Source

pub fn step_frame(&mut self, dt_ms: u16) -> bool

推进一帧动画与布局求解,并将有变化的画面提交至 GPU 共享槽或软件回退缓冲;返回是否有新帧产出。

Source

pub fn acquire_shared_frame(&mut self) -> VeloxSharedFrameDesc

宿主获取最新共享帧描述(GPU 模式返回零拷贝句柄,软件模式返回 CPU RGBA 缓冲指针)。

Source

pub fn release_shared_frame(&mut self, generation_id: u32, slot_index: u8)

宿主归还已完成采样的共享帧租约(驱动旧 Resize 显存池安全回收)。

Source

pub fn inject_pointer(&mut self, phase: u8, x: i16, y: i16) -> bool

注入指针事件(phase: 0=Down, 1=Move, 2=Up, 3=Cancel)。

Source

pub fn inject_wheel(&mut self, x: i16, y: i16, delta_y: i16) -> bool

注入滚轮事件(正值向下、负值向上)。

Source

pub fn inject_key(&mut self, code: u32, is_char: bool) -> bool

注入键盘事件(is_char == 1 时按 Unicode 码点派发字符键;否则按标准键码派发导航键)。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> FluentBuilder for T

Source§

fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self

当 condition 为 true 时执行闭包修饰自身,否则原样返回。
Source§

fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self

根据 condition 在两个修饰分支之间二选一。
Source§

fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self

当 option 为 Some(value) 时执行闭包修饰自身,否则原样返回。
Source§

fn when_none<O>( self, option: &Option<O>, then: impl FnOnce(Self) -> Self, ) -> Self

当 option 为 None 时执行闭包修饰自身,否则原样返回。
Source§

fn apply<U>(self, f: impl FnOnce(Self) -> U) -> U

通用管道映射变换(避免与 Iterator::map / Option::map 重名)。
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.