Crate libfprint_rs

source ·
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, GError};

let context = FpContext::new();
let devices = context.get_devices();

let dev = devices.iter().next().unwrap();
dev.open()?;

let template = FpPrint::new(&dev);
template.set_username("Bruce Banner");

dev.enroll(template, None, None::<()>)?;

Verifying a fingerprint

use libfprint_rs::{FpContext, FpPrint, GError};
let context = FpContext::new();
let devices = context.get_devices();

let dev = devices.iter().next().unwrap();
dev.open()?;

let enrolled_print = load_print_from_file();

let match_res = dev.verify(enrolled_print, None, None::<()>, None)?;

For more examples on how to use this crate, please refer to the github oficial repository.

Structs

  • List of fingerprint devices. This struct will allow you to iterate over the fingerprint devices.
  • Collection of fingerprint devices This struct will allow you to iterate with the fingerprint devices available in the system.
  • This struct allows you to discover fingerprint scanning hardware. This is the starting point when integrating libfprint-rs into your software.
  • Fingerpint device routines. You can interact with fingerprint devices using this struct.
  • Struct representing an image of a fingerprint. Not all devices support this feature.
  • Struct representing a fingerprint.
  • Struct representing an error while scanning a fingerprint, interacting with the device, etc.
  • Struct representing a serialized fingerprint. You can use this struct to save a fingerprint to persistent storage for later use.

Enums

  • 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.
  • Enum representing the different features that a device may support. This is used to query the device capabilities.
  • Enum representing the different types of scans that a device may support.

Type Definitions

  • This type represents the callback function for the FpDevice::enroll implementation and will be called for each stage of the enrollment process.
  • This type represents the callback function for the FpDevice::verify and FpDevice::identify implementations and will be called when a print is matched.