Struct libfprint_rs::DeviceList
source · pub struct DeviceList<'a> { /* private fields */ }
Expand description
List of fingerprint devices. This struct will allow you to iterate over the fingerprint devices.
Implementations§
source§impl<'a> DeviceList<'a>
impl<'a> DeviceList<'a>
pub fn len(&self) -> usize
sourcepub fn iter<'b>(&'b self) -> Devices<'a, 'b> ⓘ
pub fn iter<'b>(&'b self) -> Devices<'a, 'b> ⓘ
Examples found in repository?
examples/verify.rs (line 9)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
fn main() {
let context = FpContext::new();
let devices = context.get_devices();
let dev = match devices.iter().next() {
Some(dev) => dev,
None => {
eprintln!("No devices detected.");
std::process::exit(1);
}
};
let print_matched = verify(dev).unwrap();
if print_matched {
println!("Print matched");
} else {
println!("Prints don't match!!");
}
}
More examples
examples/enroll.rs (line 7)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
fn main() {
let context = FpContext::new();
let devices = context.get_devices();
let dev = match devices.iter().next() {
Some(dev) => dev,
None => {
eprintln!("No devices detected.");
std::process::exit(1);
}
};
let print = enroll(dev);
if let Ok(print) = print {
let username = print.get_username().unwrap();
println!("User provided username: \"{}\"", username);
}
}
Auto Trait Implementations§
impl<'a> RefUnwindSafe for DeviceList<'a>
impl<'a> !Send for DeviceList<'a>
impl<'a> !Sync for DeviceList<'a>
impl<'a> Unpin for DeviceList<'a>
impl<'a> UnwindSafe for DeviceList<'a>
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