#[non_exhaustive]pub enum PopupPlacementError {
InvalidAnchor,
InvalidDesiredSize,
InvalidViewport,
EmptyViewport,
InvalidGap,
MissingAnchor,
MissingDesiredSize,
UnrepresentableGeometry,
}Expand description
Invalid geometry supplied to popup placement resolution.
Validation is deterministic and performs no platform calls. The enum is non-exhaustive so downstream matches require a wildcard arm.
§Examples
use ailloli_ui_core::{Rect, Size};
use ailloli_ui_runtime::popup::{position_popup, PopupAlignment, PopupPlacement, PopupPlacementError};
assert_eq!(position_popup(Rect::new(0.0, 0.0, 0.0, 0.0), Size::new(-1.0, 2.0), PopupPlacement::Bottom, PopupAlignment::Center, 0.0), Err(PopupPlacementError::InvalidDesiredSize));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidAnchor
Anchor coordinate/size is non-finite or a dimension is negative.
InvalidDesiredSize
Desired width/height is non-finite or negative.
InvalidViewport
Viewport coordinate/size is non-finite or a dimension is negative.
EmptyViewport
Viewport width or height is exactly zero after basic validation.
InvalidGap
Gap is negative or non-finite.
MissingAnchor
A retained request was resolved before receiving an anchor.
MissingDesiredSize
A retained request was resolved before receiving desired size.
UnrepresentableGeometry
Finite inputs overflowed to non-finite positioned/clamped edges.
Trait Implementations§
Source§impl Clone for PopupPlacementError
impl Clone for PopupPlacementError
Source§fn clone(&self) -> PopupPlacementError
fn clone(&self) -> PopupPlacementError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PopupPlacementError
impl Debug for PopupPlacementError
Source§impl Display for PopupPlacementError
impl Display for PopupPlacementError
Source§impl Error for PopupPlacementError
impl Error for PopupPlacementError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for PopupPlacementError
impl PartialEq for PopupPlacementError
impl Copy for PopupPlacementError
impl Eq for PopupPlacementError
impl StructuralPartialEq for PopupPlacementError
Auto Trait Implementations§
impl Freeze for PopupPlacementError
impl RefUnwindSafe for PopupPlacementError
impl Send for PopupPlacementError
impl Sync for PopupPlacementError
impl Unpin for PopupPlacementError
impl UnwindSafe for PopupPlacementError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.