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 with_platform(platform: Rc<dyn Platform>) -> Self
pub fn with_platform(platform: Rc<dyn Platform>) -> Self
Builds an application with a caller-provided platform implementation.
Sourcepub fn inaccessible(self) -> Self
pub fn inaccessible(self) -> Self
Builds this app with accessibility integration forcibly disabled.
Sourcepub fn with_assets(self, asset_source: impl AssetSource) -> Self
pub fn with_assets(self, asset_source: impl AssetSource) -> Self
Builds this app with the given asset source.
Sourcepub fn with_http_client(self, http_client: Arc<dyn HttpClient>) -> Self
pub fn with_http_client(self, http_client: Arc<dyn HttpClient>) -> Self
Sets the HTTP client for the application.
Sourcepub fn with_resource_profile(
self,
profile: impl Into<AppResourceProfile>,
) -> Self
pub fn with_resource_profile( self, profile: impl Into<AppResourceProfile>, ) -> Self
Sets the resource profile for the application.
Sourcepub fn with_quit_mode(self, mode: QuitMode) -> Self
pub fn with_quit_mode(self, mode: QuitMode) -> Self
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) -> &Self
pub fn on_open_urls<F>(&self, callback: F) -> &Self
Registers a handler for platform open-URL requests.
Sourcepub fn on_reopen<F>(&self, callback: F) -> &Self
pub fn on_reopen<F>(&self, callback: F) -> &Self
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.
Sourcepub fn path_for_auxiliary_executable(&self, name: &str) -> Result<PathBuf>
pub fn path_for_auxiliary_executable(&self, name: &str) -> Result<PathBuf>
Returns the bundle path for an auxiliary executable.
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.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