Skip to main content

Crate namegender

Crate namegender 

Source
Expand description

Client for the NameGender API.

use namegender::{NameGender, Options};

let client = NameGender::new(std::env::var("NAMEGENDER_API_KEY").unwrap());
let result = client
    .name("Andrea", &Options { country: Some("IT".into()), ..Default::default() })
    .await?;
println!("{:?} {} {}", result.gender, result.probability, result.sample_size);

Every lookup costs one credit, unknown results included. Success is the HTTP status; any other response is returned as Error::Api carrying the API’s reason code.

Structs§

Account
Credit balance and account status. Costs no credit.
AgeBulkResponse
Response of a bulk age estimate; results is in the order the names were sent.
AgeOptions
Options for the age endpoints. Fields left as None are not sent.
AgeRange
A range of ages in years, low to high inclusive.
AgeResponse
Response of a single age estimate.
AgeResult
The typical age of the people who carry a first name. It describes a group, not a person: never use it for decisions about an individual.
BulkResponse
Response of a bulk lookup; results is in the order the values were sent.
BulkSummary
CountriesResponse
Which countries a name is recorded in. Not a country-of-origin or ethnicity inference: show basis["note"] next to any percentage.
GenderResponse
Response of a single lookup.
GenderResult
One resolved value.
NameCheckBulkResponse
Response of a bulk name check; results is in the order the names were sent.
NameCheckEvidence
What the database knows about the first name. Surnames are judged by their shape only.
NameCheckOptions
Options for the name check endpoints. Fields left as None are not sent.
NameCheckResponse
Response of a single name check.
NameCheckResult
Whether one name looks like a real person’s name. It never calls a name fake: use it to flag records, not to reject people automatically.
NameCheckSignal
One reason behind an assessment.
NameCheckSummary
NameGender
The API client. Cheap to clone; reuse one per process.
Options
Options shared by the name, email, username and bulk lookups.
Registration
SalutationBulkResponse
Response of a bulk salutation; results is in the order the names were sent.
SalutationLines
The three ready lines. neutral is always the gender-free form.
SalutationOptions
Options for the salutation endpoints. Fields left as None are not sent.
SalutationParts
Pieces of the formal line, for building your own template.
SalutationResponse
Response of a single salutation.
SalutationResult
The salutation for one name.
SalutationSummary

Enums§

Error
ValueType
How the values of a bulk request are read.