#[non_exhaustive]pub enum PointerSampleError {
NonFinitePosition,
InvalidPressure,
InvalidTilt,
InvalidTwist,
InvalidContactSize,
}Expand description
Invalid provider-neutral pointer data.
§Examples
use ailloli_ui_core::{event::{PointerId, PointerSample, PointerSampleError, PointerSource}, Point};
assert_eq!(PointerSample::new(PointerId::MOUSE, PointerSource::Mouse, Point::new(f32::NAN, 0.0)).unwrap_err(), PointerSampleError::NonFinitePosition);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.
NonFinitePosition
At least one logical position coordinate is NaN or infinite.
InvalidPressure
Pressure is non-finite or outside the normalized 0.0..=1.0 range.
InvalidTilt
Either tilt component is non-finite or outside -90.0..=90.0 degrees.
InvalidTwist
Twist is non-finite or outside the half-open 0.0..360.0 degree range.
InvalidContactSize
Contact width or height is non-finite or negative.
Trait Implementations§
Source§impl Clone for PointerSampleError
impl Clone for PointerSampleError
Source§fn clone(&self) -> PointerSampleError
fn clone(&self) -> PointerSampleError
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 PointerSampleError
impl Debug for PointerSampleError
Source§impl Display for PointerSampleError
impl Display for PointerSampleError
Source§impl Error for PointerSampleError
impl Error for PointerSampleError
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 PointerSampleError
impl PartialEq for PointerSampleError
impl Copy for PointerSampleError
impl Eq for PointerSampleError
impl StructuralPartialEq for PointerSampleError
Auto Trait Implementations§
impl Freeze for PointerSampleError
impl RefUnwindSafe for PointerSampleError
impl Send for PointerSampleError
impl Sync for PointerSampleError
impl Unpin for PointerSampleError
impl UnwindSafe for PointerSampleError
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