Crate custom_type

Source
Expand description

This crate provides utilities for parsing and validating various types of data such as emails, passwords, and phone numbers with country codes.

§Example

use custom_type::{Email, PhoneNumber, RawPassword, CountryCode};

let email = Email::parse("example@example.com").unwrap();
println!("{}", email);

let phone_number = PhoneNumber::parse(CountryCode::USA, "1234567890").unwrap();
println!("{}", phone_number);

let password = RawPassword::parse_strict("Valid123!").unwrap();
println!("{}", password);

§Features

  • Parse and validate email addresses.
  • Parse and validate phone numbers with country codes.
  • Parse and validate passwords with different strength levels.

Modules§

error

Structs§

Email
This crate provides a simple and efficient way to parse and validate email addresses.
PhoneNumber
This crate provides functionality to parse and validate phone numbers with country codes.
RawPassword
This crate provides functionality to parse and validate raw passwords with different levels of strength.
Url
Url: Parse impl ToString into a valid URL

Enums§

CountryCode
CountryCode : Enum representing country codes