pub struct FormatId(/* private fields */);Expand description
A format: a MIME-like type, type/subtype with optional parameters.
Implementations§
Source§impl FormatId
impl FormatId
Sourcepub const fn from_static(text: &'static str) -> Self
pub const fn from_static(text: &'static str) -> Self
A format from a literal; an invalid one panics (a compile error in a constant).
Sourcepub fn private(app: &str, kind: &str) -> Result<Self, String>
pub fn private(app: &str, kind: &str) -> Result<Self, String>
An application’s private type: application/x-<app>.<type>+json.
pub fn as_str(&self) -> &str
Sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Whether it is a private type (application/x-…+json).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FormatId
impl<'de> Deserialize<'de> for FormatId
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for FormatId
impl Ord for FormatId
Source§impl PartialOrd for FormatId
impl PartialOrd for FormatId
impl Eq for FormatId
impl StructuralPartialEq for FormatId
Auto Trait Implementations§
impl Freeze for FormatId
impl RefUnwindSafe for FormatId
impl Send for FormatId
impl Sync for FormatId
impl Unpin for FormatId
impl UnsafeUnpin for FormatId
impl UnwindSafe for FormatId
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