pub struct ErrorContext {
pub scancode: Option<u16>,
pub keycode: Option<u32>,
pub coordinates: Option<(f64, f64)>,
pub monitor_id: Option<u32>,
pub layout: Option<String>,
pub attempt: u32,
pub details: String,
}Expand description
Error context for recovery decisions
Fields§
§scancode: Option<u16>Scancode if applicable
keycode: Option<u32>Keycode if applicable
coordinates: Option<(f64, f64)>Mouse coordinates if applicable
monitor_id: Option<u32>Monitor ID if applicable
layout: Option<String>Keyboard layout if applicable
attempt: u32Retry attempt number
details: StringAdditional context information
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_scancode(self, scancode: u16) -> Self
pub fn with_scancode(self, scancode: u16) -> Self
Set scancode
Sourcepub fn with_keycode(self, keycode: u32) -> Self
pub fn with_keycode(self, keycode: u32) -> Self
Set keycode
Sourcepub fn with_coordinates(self, x: f64, y: f64) -> Self
pub fn with_coordinates(self, x: f64, y: f64) -> Self
Set coordinates
Sourcepub fn with_monitor_id(self, id: u32) -> Self
pub fn with_monitor_id(self, id: u32) -> Self
Set monitor ID
Sourcepub fn with_layout(self, layout: impl Into<String>) -> Self
pub fn with_layout(self, layout: impl Into<String>) -> Self
Set layout
Sourcepub fn with_attempt(self, attempt: u32) -> Self
pub fn with_attempt(self, attempt: u32) -> Self
Set attempt number
Sourcepub fn with_details(self, details: impl Into<String>) -> Self
pub fn with_details(self, details: impl Into<String>) -> Self
Set details
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorContext
impl Debug for ErrorContext
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnwindSafe for ErrorContext
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)