bookclerk_library::email
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. |
pub fn normalize_user_email(email: Option<&str>) -> Result<Option<String>>
Trim, lowercase, and validate a contact email; empty becomes None.
Returns LibraryError::InvalidEmail when the value is non-empty but not a
valid address (including a domain without a dot, such as user@gmail).
pub fn is_valid_user_email(value: &str) -> bool
True when value is a syntactically valid email with a dotted domain.
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