Fuse-rust

What is Fuse?

Fuse is a super lightweight library which provides a simple way to do fuzzy searching.

Fuse-RS is a port of https://github.com/krisk/fuse-swift written purely in rust.

Usage

An example of a real use case, a search bar made using iced is also available.

Try it using shell cargo run --package search_bar

Check all available examples and their source code here.

Async

Use the feature flag "async" to also be able to use async functions. toml fuse-rust = { version = ..., features = ["async"]}

Initializing

The first step is to create a fuse object, with the necessary parameters. Fuse::default, returns the following parameters. rust Fuse::default() = Fuse{ location: 0, // Approx where to start looking for the pattern distance: 100, // Maximum distance the score should scale to threshold: 0.6, // A threshold for guess work max_pattern_length: 32, // max valid pattern length is_case_sensitive: false, tokenize: false, // the input search text should be tokenized } For how to implement individual searching operations, check the examples.

Options

As given above, Fuse takes the following options