pub struct App {
pub windows: Vec<Window>,
pub env: Environment,
}Expand description
Represents a WaterUI application.
Fields§
§windows: Vec<Window>Application windows. The first window is the main window.
env: EnvironmentThe application environment containing injected services.
Implementations§
Source§impl App
impl App
Sourcepub fn new(content: impl View, env: Environment) -> Self
pub fn new(content: impl View, env: Environment) -> Self
Create a new application with the given main content view and environment.
This injects a FullScreenOverlayManager into the environment and wraps
the content with a [ZStack] overlay layer.
Sourcepub fn main_window(&self) -> &Window
pub fn main_window(&self) -> &Window
Get a reference to the main (first) window.
Sourcepub fn main_window_mut(&mut self) -> &mut Window
pub fn main_window_mut(&mut self) -> &mut Window
Get a mutable reference to the main (first) window.
Sourcepub fn window(self, window: Window) -> Self
pub fn window(self, window: Window) -> Self
Add an additional window to the application.
Use this for multi-window applications on platforms that support it.
Sourcepub fn title(self, title: impl IntoComputed<Str>) -> Self
pub fn title(self, title: impl IntoComputed<Str>) -> Self
Set the title of the main application window.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl !Send for App
impl !Sync for App
impl Unpin for App
impl !UnwindSafe for App
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more