bookclerk_library::email

Development These docs follow the development version and change with every merge.

Last updated View as Markdown

Contact-email normalization and library-backed validation.

Item Kind Summary
normalize_user_email function Trim, lowercase, and validate a contact email; empty becomes None.
is_valid_user_email function True when value is a syntactically valid email with a dotted domain.
gravatar_hash function SHA-256 hex digest of a trimmed, lowercased email for Gravatar URLs.

Functions

normalize_user_email

pub fn normalize_user_email(email: Option<&str>) -> Result<Option<String>>

Trim, lowercase, and validate a contact email; empty becomes None.

Errors

Returns LibraryError::InvalidEmail when the value is non-empty but not a valid address (including a domain without a dot, such as user@gmail).

is_valid_user_email

pub fn is_valid_user_email(value: &str) -> bool

True when value is a syntactically valid email with a dotted domain.

gravatar_hash

pub fn gravatar_hash(email: &str) -> String

SHA-256 hex digest of a trimmed, lowercased email for Gravatar URLs.

Gravatar matches on this digest; callers should pass a stored/normalized address. Empty or whitespace-only input still hashes (callers should skip).

Generated from crates/bookclerk-library at main · View as Markdown