Expand description
Rust bindings for libfprint.
This crate provides a wrapper around the libfprint library, which allows you to use fingerprint scanners in your Rust applications.
§Enrolling a new fingerprint
use libfprint_rs::{FpContext, FpPrint};
let context = FpContext::new();
let devices = context.get_devices();
let context = FpContext::new();
let devices = context.devices();
let dev = devices.get(0).unwrap();
dev.open_sync(None)?;
let template = FpPrint::new(&dev);
template.set_username("Bruce Banner");
let print = dev.enroll_sync(template, None, None, None::<()>)?;
§Verifying a fingerprint
let context = FpContext::new();
let devices = context.devices();
let dev = devices.get(0).unwrap();
dev.open_sync(None)?;
let enrolled_print = load_print_from_file();
let match_res = dev.verify_sync(enrolled_print, None, None, None::<()>, None)?;
For more examples on how to use this crate, please refer to the github oficial repository and the documentation.
Structs§
- Cancellable
- Re-export
gio::Cancellable
, it provides a way to cancel sync operations, i.eFpDevice::enroll_sync
- FpContext
- This struct allows you to discover fingerprint scanning hardware. This is the starting point when integrating libfprint-rs into your software.
- FpDevice
- Fingerpint device routines. You can interact with fingerprint devices using this struct.
- FpImage
- Struct representing an image of a fingerprint. Not all devices support this feature.
- FpPrint
- Struct representing a fingerprint.
- GDate
- Re-export
glib::Error
, it provides a way to pass enroll dates toFpPrint
metadata - GError
- Re-export
glib::Error
, it provides error handling for sync operations. A generic error capable of representing various error domains (types).
Enums§
- FpFinger
- Enum representing a finger. This can be used to specify which finger was used to enroll a new print and can be added as part of the print metadata.
Traits§
Type Aliases§
- FpEnroll
Progress - This type represents the callback function for the
FpDevice::enroll
implementation and will be called for each stage of the enrollment process. - FpMatch
Cb - This type represents the callback function for the
FpDevice::verify
andFpDevice::identify
implementations and will be called when a print is matched.