Skip to main content

BoundsExt

Trait BoundsExt 

Source
pub trait BoundsExt: Sized {
    // Required methods
    fn centered(
        display_id: Option<DisplayId>,
        size: Size<Pixels>,
        cx: &App,
    ) -> Self;
    fn maximized(display_id: Option<DisplayId>, cx: &App) -> Self;
}
Expand description

Extension methods on Bounds that need to resolve the application’s displays.

These live here rather than in gpui_types because they require App, while the base Bounds type is defined in the platform-agnostic gpui_types crate.

Required Methods§

Source

fn centered(display_id: Option<DisplayId>, size: Size<Pixels>, cx: &App) -> Self

Generate a centered bounds for the given display or primary display if none is provided

Source

fn maximized(display_id: Option<DisplayId>, cx: &App) -> Self

Generate maximized bounds for the given display or primary display if none is provided

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§