pub struct VeloxEmbedSession {
pub engine: VeloxEngine,
/* private fields */
}Expand description
单个可多实例并行的宿主嵌入会话(统一承载 VeloxEngine + GPU 共享导出器或软件缓冲回退)。
Fields§
§engine: VeloxEngineImplementations§
Source§impl VeloxEmbedSession
impl VeloxEmbedSession
Sourcepub fn new<V: View>(
root_view: V,
logical_width: i16,
logical_height: i16,
scale_factor: f32,
config: VeloxHostAdapterConfig,
) -> Self
pub fn new<V: View>( root_view: V, logical_width: i16, logical_height: i16, scale_factor: f32, config: VeloxHostAdapterConfig, ) -> Self
创建一个挂载指定根视图的跨框架嵌入会话。
Sourcepub fn backend_is_gpu(&self) -> bool
pub fn backend_is_gpu(&self) -> bool
返回当前会话是否激活了 GPU 硬件共享导出后端。
Sourcepub fn gpu_exporter_mut(&mut self) -> Option<&mut WgpuSharedExportRenderer>
pub fn gpu_exporter_mut(&mut self) -> Option<&mut WgpuSharedExportRenderer>
返回底层 GPU 共享导出器可变引用(供 Rust 宿主直接注册外部零拷贝纹理或检查句柄)。
Sourcepub fn resize(
&mut self,
logical_width: i16,
logical_height: i16,
scale_factor: f32,
)
pub fn resize( &mut self, logical_width: i16, logical_height: i16, scale_factor: f32, )
调整嵌入视口的逻辑尺寸与缩放因子。
Sourcepub fn step_frame(&mut self, dt_ms: u16) -> bool
pub fn step_frame(&mut self, dt_ms: u16) -> bool
推进一帧动画与布局求解,并将有变化的画面提交至 GPU 共享槽或软件回退缓冲;返回是否有新帧产出。
宿主获取最新共享帧描述(GPU 模式返回零拷贝句柄,软件模式返回 CPU RGBA 缓冲指针)。
宿主归还已完成采样的共享帧租约(驱动旧 Resize 显存池安全回收)。
Sourcepub fn inject_pointer(&mut self, phase: u8, x: i16, y: i16) -> bool
pub fn inject_pointer(&mut self, phase: u8, x: i16, y: i16) -> bool
注入指针事件(phase: 0=Down, 1=Move, 2=Up, 3=Cancel)。
Sourcepub fn inject_key(&mut self, code: u32, is_char: bool) -> bool
pub fn inject_key(&mut self, code: u32, is_char: bool) -> bool
注入键盘事件(is_char == 1 时按 Unicode 码点派发字符键;否则按标准键码派发导航键)。
Auto Trait Implementations§
impl !Freeze for VeloxEmbedSession
impl !RefUnwindSafe for VeloxEmbedSession
impl !Send for VeloxEmbedSession
impl !Sync for VeloxEmbedSession
impl !UnwindSafe for VeloxEmbedSession
impl Forget for VeloxEmbedSession
impl Move for VeloxEmbedSession
impl Unpin for VeloxEmbedSession
impl UnsafeUnpin for VeloxEmbedSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
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
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
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。