#[non_exhaustive]pub struct Id(/* private fields */);Expand description
Opaque non-empty server-assigned identifier (RFC 8620 §1.2).
Character set: URL-safe base64 alphabet (A-Za-z0-9, -, _), max 255 octets.
Clients MUST treat Id values as opaque strings — no parsing of structure.
Implementations§
Source§impl Id
impl Id
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes the value and returns the inner String.
Source§impl Id
impl Id
Sourcepub fn new_validated(s: impl Into<String>) -> Result<Self, ValidationError>
pub fn new_validated(s: impl Into<String>) -> Result<Self, ValidationError>
Construct an Id with RFC 8620 §1.2 syntax validation.
Rejects empty strings, strings longer than 255 bytes, and strings
containing characters outside the SAFE-CHAR set (%x21 / %x23-7E —
visible ASCII excluding ").
Use Id::from when the value is known to be valid (e.g. a string
received from a JMAP server response).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnsafeUnpin for Id
impl UnwindSafe for Id
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