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};

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

  • Re-export gio::Cancellable, it provides a way to cancel sync operations, i.e FpDevice::enroll_sync
  • 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.
  • Re-export glib::Error, it provides a way to pass enroll dates to FpPrint metadata
  • Re-export glib::Error, it provides error handling for sync operations. A generic error capable of representing various error domains (types).

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.

Traits

Type Aliases

  • 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.