FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Screens

    struct · ferroui-controls · v0.5.0

    struct Screens
    

    Represents all screens available on a device.

    View source

    Members

    screen_count

    fn screen_count(self: &Self) -> i32
    

    The number of screens available on the device.

    Source

    all

    fn all(self: &Self) -> Vec<Rc<Screen>>
    

    All screens available on the device.

    Source

    primary

    fn primary(self: &Self) -> Option<Rc<Screen>>
    

    The primary screen on the device.

    Source

    changed

    fn changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Fired when screens are added or removed, or when a screen's properties change.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the screens.

    Source

    screen_from_bounds

    fn screen_from_bounds(self: &Self, bounds: PixelRect) -> Option<Rc<Screen>>
    

    Retrieves the screen that contains the largest area of the specified bounds.

    Source

    screen_from_window

    fn screen_from_window(self: &Self, window: &WindowBase) -> Option<Rc<Screen>>
    

    Retrieves the screen for the specified window.

    Panics

    Panics when the window platform implementation was already disposed.

    Source

    screen_from_top_level

    fn screen_from_top_level(self: &Self, top_level: &TopLevel) -> Option<Rc<Screen>>
    

    Retrieves the screen for the specified top-level.

    Panics

    Panics when the platform implementation was already disposed.

    Source

    screen_from_point

    fn screen_from_point(self: &Self, point: PixelPoint) -> Option<Rc<Screen>>
    

    Retrieves the screen that contains the specified point.

    Source

    screen_from_visual

    fn screen_from_visual(self: &Self, visual: &Visual) -> Option<Rc<Screen>>
    

    Retrieves the screen that contains the specified visual.

    Panics

    Panics when the visual does not belong to a visual tree.

    Source

    request_screen_details

    fn request_screen_details(self: &Self) -> Pin<Box<dyn Future<Output = bool>>>
    

    Asks the underlying system for permission to get more detailed information about screens.

    On the browser platform the user has to grant permission; on other platforms the details are always available.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.