pub struct EmailAddress(/* private fields */);Expand description
Elektron pochta manzili (local-part@domain.tld), lowercase saqlanadi. Faqat ASCII.
Implementations§
Source§impl EmailAddress
impl EmailAddress
Sourcepub fn parse(value: &str) -> Result<Self, EmailAddressError>
pub fn parse(value: &str) -> Result<Self, EmailAddressError>
Matndan tip yaratadi: trim → normalizatsiya → validatsiya.
Bitta allocation (normalizatsiya qilingan nusxa uchun).
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Ichki String (ownership ko’chadi, nusxa olinmaydi).
Source§impl EmailAddress
impl EmailAddress
Sourcepub const LOCAL_PART_MAX_LEN: usize = 64
pub const LOCAL_PART_MAX_LEN: usize = 64
RFC 5321: local-part maksimal uzunligi, baytda.
Sourcepub const DOMAIN_MAX_LEN: usize = 253
pub const DOMAIN_MAX_LEN: usize = 253
RFC 1035: domain maksimal uzunligi, baytda.
Sourcepub const DOMAIN_LABEL_MAX_LEN: usize = 63
pub const DOMAIN_LABEL_MAX_LEN: usize = 63
RFC 1035: bitta label maksimal uzunligi, baytda.
Sourcepub const TLD_MIN_LEN: usize = 2
pub const TLD_MIN_LEN: usize = 2
TLD minimal uzunligi, baytda.
Sourcepub fn local_part(&self) -> &str
pub fn local_part(&self) -> &str
@ dan oldingi qism. Panic yo’li yo’q (expect o’rniga split_once).
Trait Implementations§
Source§impl AsRef<str> for EmailAddress
impl AsRef<str> for EmailAddress
Source§impl Borrow<str> for EmailAddress
HashMap<$Name, V>::get("...") va BTreeMap uchun.
Hash/Eq/Ord ichki String dan derive qilingani uchun str bilan mos.
impl Borrow<str> for EmailAddress
HashMap<$Name, V>::get("...") va BTreeMap uchun.
Hash/Eq/Ord ichki String dan derive qilingani uchun str bilan mos.
Source§impl Clone for EmailAddress
impl Clone for EmailAddress
Source§impl Debug for EmailAddress
impl Debug for EmailAddress
Source§impl<'r, DB: Database> Decode<'r, DB> for EmailAddress
impl<'r, DB: Database> Decode<'r, DB> for EmailAddress
Source§impl<'r, DB: Database> Decode<'r, DB> for EmailAddress
impl<'r, DB: Database> Decode<'r, DB> for EmailAddress
Source§impl<'de> Deserialize<'de> for EmailAddress
Available on crate feature serde only.
impl<'de> Deserialize<'de> for EmailAddress
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for EmailAddress
impl Display for EmailAddress
Source§impl<'q, DB: Database> Encode<'q, DB> for EmailAddress
impl<'q, DB: Database> Encode<'q, DB> for EmailAddress
Source§fn encode_by_ref(
&self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer<'q>,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
Source§impl<'q, DB: Database> Encode<'q, DB> for EmailAddress
impl<'q, DB: Database> Encode<'q, DB> for EmailAddress
Source§fn encode_by_ref(
&self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, BoxDynError>
fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer, ) -> Result<IsNull, BoxDynError>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
impl Eq for EmailAddress
Source§impl From<EmailAddress> for String
impl From<EmailAddress> for String
Source§fn from(value: EmailAddress) -> Self
fn from(value: EmailAddress) -> Self
Converts to this type from the input type.
Source§impl FromStr for EmailAddress
impl FromStr for EmailAddress
Source§impl Hash for EmailAddress
impl Hash for EmailAddress
Source§impl Ord for EmailAddress
impl Ord for EmailAddress
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for EmailAddress
impl PartialEq for EmailAddress
Source§impl PartialOrd for EmailAddress
impl PartialOrd for EmailAddress
Source§impl PgHasArrayType for EmailAddresswhere
String: PgHasArrayType,
impl PgHasArrayType for EmailAddresswhere
String: PgHasArrayType,
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
Source§impl PgHasArrayType for EmailAddresswhere
String: PgHasArrayType,
impl PgHasArrayType for EmailAddresswhere
String: PgHasArrayType,
fn array_type_info() -> PgTypeInfo
fn array_compatible(ty: &PgTypeInfo) -> bool
Source§impl Serialize for EmailAddress
Available on crate feature serde only.
impl Serialize for EmailAddress
Available on crate feature
serde only.impl StructuralPartialEq for EmailAddress
Source§impl TryFrom<&str> for EmailAddress
impl TryFrom<&str> for EmailAddress
Source§type Error = EmailAddressError
type Error = EmailAddressError
The type returned in the event of a conversion error.
Source§impl TryFrom<String> for EmailAddress
Yagona “owned” yo’l: hech qachon qo’shimcha allocation qilmaydi.
impl TryFrom<String> for EmailAddress
Yagona “owned” yo’l: hech qachon qo’shimcha allocation qilmaydi.
Source§type Error = EmailAddressError
type Error = EmailAddressError
The type returned in the event of a conversion error.
Source§impl<DB: Database> Type<DB> for EmailAddress
impl<DB: Database> Type<DB> for EmailAddress
Source§impl<DB: Database> Type<DB> for EmailAddress
impl<DB: Database> Type<DB> for EmailAddress
Auto Trait Implementations§
impl Freeze for EmailAddress
impl RefUnwindSafe for EmailAddress
impl Send for EmailAddress
impl Sync for EmailAddress
impl Unpin for EmailAddress
impl UnsafeUnpin for EmailAddress
impl UnwindSafe for EmailAddress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more