pub struct DesktopPlatform { /* private fields */ }Implementations§
Source§impl DesktopPlatform
impl DesktopPlatform
pub fn new() -> Self
pub fn with_feather_width(self, feather_width: f32) -> Self
pub fn with_feathering_enabled(self, enabled: bool) -> Self
Sourcepub fn with_vsync_enabled(self, enabled: bool) -> Self
pub fn with_vsync_enabled(self, enabled: bool) -> Self
Enable synchronized presentation. Focused, drawable windows continue presenting retained content so variable-refresh displays stay responsive.
pub fn with_external_texture_registry( self, registry: WgpuExternalTextureRegistry, ) -> Self
pub fn with_automation(self, automation: DesktopAutomationConfig) -> Self
Sourcepub fn with_extension(self, extension: impl DesktopExtension + 'static) -> Self
pub fn with_extension(self, extension: impl DesktopExtension + 'static) -> Self
Attach an optional UI-thread desktop integration.
pub fn renderer(&self) -> &WgpuRenderer
pub fn feather_width(&self) -> f32
pub fn feathering_enabled(&self) -> bool
pub fn vsync_enabled(&self) -> bool
pub fn set_feather_width(&mut self, feather_width: f32)
pub fn set_feathering_enabled(&mut self, enabled: bool)
pub fn set_vsync_enabled(&mut self, enabled: bool)
pub fn set_external_texture_registry( &mut self, registry: WgpuExternalTextureRegistry, )
pub fn renderer_mut(&mut self) -> &mut WgpuRenderer
pub fn run(self, runtime: Runtime) -> Result<Vec<PlatformWindow>>
Sourcepub fn run_with(
self,
runtime: Runtime,
on_ready: impl FnOnce(CommandSender),
) -> Result<Vec<PlatformWindow>>
pub fn run_with( self, runtime: Runtime, on_ready: impl FnOnce(CommandSender), ) -> Result<Vec<PlatformWindow>>
Like run but hands the caller a typed, thread-safe
CommandSender before the loop starts.
Sourcepub fn start_pumped(
self,
runtime: Runtime,
on_ready: impl FnOnce(CommandSender),
) -> Result<PumpedDesktop>
pub fn start_pumped( self, runtime: Runtime, on_ready: impl FnOnce(CommandSender), ) -> Result<PumpedDesktop>
Start the application without blocking: the caller drives the event
loop by calling PumpedDesktop::pump repeatedly, for example from
another framework’s event loop.
Like run_with, this must be called on the main
thread, and only once per process.
Trait Implementations§
Source§impl Debug for DesktopPlatform
impl Debug for DesktopPlatform
Auto Trait Implementations§
impl !Freeze for DesktopPlatform
impl !RefUnwindSafe for DesktopPlatform
impl !Send for DesktopPlatform
impl !Sync for DesktopPlatform
impl !UnwindSafe for DesktopPlatform
impl Forget for DesktopPlatform
impl Move for DesktopPlatform
impl Unpin for DesktopPlatform
impl UnsafeUnpin for DesktopPlatform
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.