pub struct EdgeResistance {
pub config: EdgeResistanceConfig,
pub prev_x: Option<i32>,
pub prev_y: Option<i32>,
pub entered_magnetic_x_at: Option<u64>,
pub entered_magnetic_y_at: Option<u64>,
}Fields§
§config: EdgeResistanceConfig§prev_x: Option<i32>§prev_y: Option<i32>§entered_magnetic_x_at: Option<u64>Wall-clock nanosecond timestamp when the cursor first entered the
magnetic zone on the current axis. Pure integer; no std::time types.
entered_magnetic_y_at: Option<u64>Implementations§
Source§impl EdgeResistance
impl EdgeResistance
pub fn new(config: EdgeResistanceConfig) -> Self
pub fn default_tui() -> Self
Sourcepub fn apply_x(&mut self, new_x: i32, bounds: LayoutRect, now_ns: u64) -> i32
pub fn apply_x(&mut self, new_x: i32, bounds: LayoutRect, now_ns: u64) -> i32
Apply X-axis magnetic resistance.
now_ns is a raw nanosecond timestamp (from Instant::now()
converted to nanos-since-epoch in the caller). The layout engine
treats it as an opaque integer — no std::time types are used.
Sourcepub fn apply_y(&mut self, new_y: i32, bounds: LayoutRect, now_ns: u64) -> i32
pub fn apply_y(&mut self, new_y: i32, bounds: LayoutRect, now_ns: u64) -> i32
Apply Y-axis magnetic resistance.
pub fn apply(&mut self, new_x: i32, bounds: LayoutRect, now_ns: u64) -> i32
Trait Implementations§
Source§impl Clone for EdgeResistance
impl Clone for EdgeResistance
Source§fn clone(&self) -> EdgeResistance
fn clone(&self) -> EdgeResistance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EdgeResistance
impl RefUnwindSafe for EdgeResistance
impl Send for EdgeResistance
impl Sync for EdgeResistance
impl Unpin for EdgeResistance
impl UnsafeUnpin for EdgeResistance
impl UnwindSafe for EdgeResistance
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