pub struct ContactDeviceDescriptor {
pub x_range: Range,
pub y_range: Range,
pub x_unit: Unit,
pub y_unit: Unit,
pub pressure_range: Option<Range>,
pub width_range: Option<Range>,
pub height_range: Option<Range>,
}Expand description
A ContactDeviceDescriptor describes the possible values touch contact properties can take on.
This descriptor can be used, for example, to determine where on a screen a touch made contact.
§Example
// Determine the scaling factor between the display and the touch device's x range.
let scaling_factor =
display_width / (contact_descriptor._x_range.end - contact_descriptor._x_range.start);
// Use the scaling factor to scale the contact report's x position.
let hit_location =
scaling_factor * (contact_report.position_x - contact_descriptor._x_range.start);Fields§
§x_range: RangeThe range of possible x values for this touch contact.
y_range: RangeThe range of possible y values for this touch contact.
x_unit: UnitThe unit of measure for x_range.
y_unit: UnitThe unit of measure for y_range.
pressure_range: Option<Range>The range of possible pressure values for this touch contact.
width_range: Option<Range>The range of possible widths for this touch contact.
height_range: Option<Range>The range of possible heights for this touch contact.
Trait Implementations§
Source§impl Clone for ContactDeviceDescriptor
impl Clone for ContactDeviceDescriptor
Source§fn clone(&self) -> ContactDeviceDescriptor
fn clone(&self) -> ContactDeviceDescriptor
Returns a duplicate 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 ContactDeviceDescriptor
impl Debug for ContactDeviceDescriptor
Source§impl PartialEq for ContactDeviceDescriptor
impl PartialEq for ContactDeviceDescriptor
impl Eq for ContactDeviceDescriptor
impl StructuralPartialEq for ContactDeviceDescriptor
Auto Trait Implementations§
impl Freeze for ContactDeviceDescriptor
impl RefUnwindSafe for ContactDeviceDescriptor
impl Send for ContactDeviceDescriptor
impl Sync for ContactDeviceDescriptor
impl Unpin for ContactDeviceDescriptor
impl UnwindSafe for ContactDeviceDescriptor
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,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more