Screens
struct · ferroui-controls · v0.5.0
struct Screens
Represents all screens available on a device.
Members
screen_countallprimarychangedscreen_from_boundsscreen_from_windowscreen_from_top_levelscreen_from_pointscreen_from_visualrequest_screen_details
screen_count
fn screen_count(self: &Self) -> i32
The number of screens available on the device.
all
fn all(self: &Self) -> Vec<Rc<Screen>>
All screens available on the device.
primary
fn primary(self: &Self) -> Option<Rc<Screen>>
The primary screen on the device.
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.
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.
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.
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.
screen_from_point
fn screen_from_point(self: &Self, point: PixelPoint) -> Option<Rc<Screen>>
Retrieves the screen that contains the specified point.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.