pub struct Application(/* private fields */);Expand description
Configures and launches a GPUI application.
This compatibility wrapper keeps platform selection in the published package while all application state and callback types remain core types.
Implementations§
Source§impl Application
impl Application
Sourcepub fn new() -> Application
pub fn new() -> Application
Builds an application using the current desktop platform.
Sourcepub fn headless() -> Application
pub fn headless() -> Application
Builds an application using the current platform in headless mode.
Sourcepub fn with_platform(platform: Rc<dyn Platform>) -> Application
pub fn with_platform(platform: Rc<dyn Platform>) -> Application
Builds an application with a caller-provided platform implementation.
Sourcepub fn inaccessible(self) -> Application
pub fn inaccessible(self) -> Application
Builds this app with accessibility integration forcibly disabled.
Sourcepub fn with_assets(self, asset_source: impl AssetSource) -> Application
pub fn with_assets(self, asset_source: impl AssetSource) -> Application
Builds this app with the given asset source.
Sourcepub fn with_restart_arguments(self, arguments: Vec<OsString>) -> Application
pub fn with_restart_arguments(self, arguments: Vec<OsString>) -> Application
Sets the arguments passed to the application binary on restart.
Sourcepub fn with_http_client(self, http_client: Arc<dyn HttpClient>) -> Application
pub fn with_http_client(self, http_client: Arc<dyn HttpClient>) -> Application
Sets the HTTP client for the application.
Sourcepub fn with_resource_profile(
self,
profile: impl Into<AppResourceProfile>,
) -> Application
pub fn with_resource_profile( self, profile: impl Into<AppResourceProfile>, ) -> Application
Sets the resource profile for the application.
Sourcepub fn with_quit_mode(self, mode: QuitMode) -> Application
pub fn with_quit_mode(self, mode: QuitMode) -> Application
Configures when the application should automatically quit.
By default, QuitMode::Default is used.
Sourcepub fn run_embedded<F>(self, on_finish_launching: F) -> ApplicationHandle
pub fn run_embedded<F>(self, on_finish_launching: F) -> ApplicationHandle
Starts an application whose run loop is driven by an embedder.
Sourcepub fn on_open_urls<F>(&self, callback: F) -> &Application
pub fn on_open_urls<F>(&self, callback: F) -> &Application
Registers a handler for platform open-URL requests.
Sourcepub fn on_reopen<F>(&self, callback: F) -> &Application
pub fn on_reopen<F>(&self, callback: F) -> &Application
Registers a handler for reopening an already-running application.
Sourcepub fn background_executor(&self) -> BackgroundExecutor
pub fn background_executor(&self) -> BackgroundExecutor
Returns the application’s background executor.
Sourcepub fn foreground_executor(&self) -> ForegroundExecutor
pub fn foreground_executor(&self) -> ForegroundExecutor
Returns the application’s foreground executor.
Sourcepub fn text_system(&self) -> Arc<TextSystem> ⓘ
pub fn text_system(&self) -> Arc<TextSystem> ⓘ
Returns the application’s text system.
Auto Trait Implementations§
impl !RefUnwindSafe for Application
impl !Send for Application
impl !Sync for Application
impl !UnwindSafe for Application
impl Freeze 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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more