pub trait WindowPositioner: Send + Sync {
// Required method
fn compute_position<'life0, 'async_trait>(
&'life0 self,
request: PositionRequest,
) -> Pin<Box<dyn Future<Output = Result<WindowPosition, HostApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Calculates the optimal window position from configuration and platform state.
Three-tier priority (mutually exclusive, first match wins):
enable_drag_window+ validsaved_position→ use saved positionfollow_mouse→ center on the monitor containing the cursor- Neither → center on the primary monitor
Required Methods§
Sourcefn compute_position<'life0, 'async_trait>(
&'life0 self,
request: PositionRequest,
) -> Pin<Box<dyn Future<Output = Result<WindowPosition, HostApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compute_position<'life0, 'async_trait>(
&'life0 self,
request: PositionRequest,
) -> Pin<Box<dyn Future<Output = Result<WindowPosition, HostApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compute the optimal window position. Returns the position in physical pixels, or an error if unrecoverable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".