pub struct Identifier {
    pub min_rarity: f32,
    pub max_rarity: f32,
    pub tags: Vec<String>,
    pub exclude_tags: Vec<String>,
    pub boundaryless: bool,
    pub file_support: bool,
}

Fields

min_rarity: f32

Keep Data having minimum Rarity of supplied min_rarity

max_rarity: f32

Keep Data having maximum Rarity of supplied max_rarity

tags: Vec<String>

Only include the Data which have at least one of the specified tags

exclude_tags: Vec<String>

Only include Data which doesn’t have any of the excluded_tags

boundaryless: bool

Use boundaryless regex

file_support: bool

Scan files having supplied text as filename

Implementations

Identify the given bytes.

Finds all possible identifications.

Arguments
  • text: &u8 - text which we want to identify
Examples
let identifier = lemmeknow::bytes::Identifier::default();
let text = b"UC11L3JDgDQMyH8iolKkVZ4w";
let result = identifier.identify(text);
assert_eq!(result[0].data.name, "YouTube Channel ID");

This returns the first identification.

Due to how data is stored, this means that the returned result has the highest rarity.

Arguments
  • text: &u8 - text which we want to identify
Examples
let identifier = lemmeknow::bytes::Identifier::default();
let some_result = identifier.first_match(b"8888888888");
let not_gonna_find = identifier.first_match(b"a friend for swanandx");
  
assert_eq!(some_result.unwrap().data.name, "Phone Number");
assert!(not_gonna_find.is_none());

Convert Vec<Match> to JSON

Returns prettified JSON string.

Helpful if you want to convert possible identifications to JSON for using in web APIs or something else.

Arguments
  • result: &Match - Reference to Vec<Match>.
Examples
use lemmeknow::Identifier;
let identifier = Identifier::default();
let result = identifier.identify("UC11L3JDgDQMyH8iolKkVZ4w");
let result_in_json = Identifier::to_json(&result);
println!("{result_in_json}");

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.