pub struct Collection { /* private fields */ }Expand description
Collections group Fields together into logical or physical groups.
For example, a set of buttons and x/y axes may be grouped together to represent a Mouse device. Each Field may belong to a number of collections.
let collection = field.collections.first().unwrap();
match collection.collection_type() {
CollectionType::Physical => println!("This field is part of a physical collection"),
_ => {},
}Implementations§
Source§impl Collection
impl Collection
Sourcepub fn id(&self) -> &CollectionId
pub fn id(&self) -> &CollectionId
Returns the unique ID for this collection
Sourcepub fn collection_type(&self) -> CollectionType
pub fn collection_type(&self) -> CollectionType
Return the type of this collection (e.g. physical, logical, …)
Trait Implementations§
Source§impl Clone for Collection
impl Clone for Collection
Source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
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 Collection
impl Debug for Collection
Source§impl Hash for Collection
impl Hash for Collection
Source§impl PartialEq for Collection
impl PartialEq for Collection
impl Eq for Collection
Auto Trait Implementations§
impl Freeze for Collection
impl RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl UnwindSafe for Collection
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