pub struct RuntimeApplication { /* private fields */ }Implementations§
Source§impl Application
impl Application
pub fn new() -> Application
pub fn window(self, window: WindowBuilder) -> Application
Sourcepub fn controller(
self,
controller: impl CommandController + 'static,
) -> Application
pub fn controller( self, controller: impl CommandController + 'static, ) -> Application
Attach an application-scoped non-widget controller.
Sourcepub fn url_policy(self, policy: UrlPolicy) -> Application
pub fn url_policy(self, policy: UrlPolicy) -> Application
Decide which URLs EventCtx::open_url hands to the platform, in place
of the default that opens only http, https, and mailto URLs. See
UrlPolicy.
Sourcepub fn on_command<T, F>(self, key: CommandKey<T>, handler: F) -> Application
pub fn on_command<T, F>(self, key: CommandKey<T>, handler: F) -> Application
Subscribe an application-scoped handler to a typed command.
pub fn register_font( &mut self, handle: FontHandle, font: RegisteredFont, ) -> Result<(), Error>
pub fn register_font_bytes( &mut self, data: impl Into<Vec<u8>>, ) -> Result<FontHandle, Error>
pub fn register_image( &mut self, handle: ImageHandle, image: RegisteredImage, ) -> Result<(), Error>
pub fn register_svg_image_with_handle( &mut self, handle: ImageHandle, data: impl AsRef<[u8]>, ) -> Result<(), Error>
pub fn register_rgba_image( &mut self, width: u32, height: u32, data: impl Into<Vec<u8>>, ) -> Result<ImageHandle, Error>
pub fn register_svg_image( &mut self, data: impl AsRef<[u8]>, ) -> Result<ImageHandle, Error>
pub fn register_svg_image_at_size_with_handle( &mut self, handle: ImageHandle, width: u32, height: u32, data: impl AsRef<[u8]>, ) -> Result<(), Error>
pub fn register_svg_image_at_size( &mut self, width: u32, height: u32, data: impl AsRef<[u8]>, ) -> Result<ImageHandle, Error>
pub fn register_embedded_svg_image( &mut self, resource: EmbeddedSvgImageResource, ) -> Result<(), Error>
pub fn register_embedded_svg_images( &mut self, resources: impl IntoIterator<Item = EmbeddedSvgImageResource>, ) -> Result<(), Error>
pub fn build(self) -> Result<Runtime, Error>
Trait Implementations§
Source§impl Default for Application
impl Default for Application
Source§fn default() -> Application
fn default() -> Application
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Application
impl !Send for Application
impl !Sync for Application
impl !UnwindSafe for Application
impl Forget for Application
impl Freeze for Application
impl Move for Application
impl Unpin for Application
impl UnsafeUnpin for Application
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.