pub struct ContentType { /* private fields */ }Implementations§
Source§impl ContentType
impl ContentType
Sourcepub const SNIFFED_LENGTH: usize = 12
pub const SNIFFED_LENGTH: usize = 12
The first bytes sniff and matches need.
pub fn parse(text: &str) -> Result<Self>
pub fn octet_stream() -> Self
pub fn as_str(&self) -> &str
Sourcepub fn sniff(start: &[u8]) -> Option<Self>
pub fn sniff(start: &[u8]) -> Option<Self>
None when the bytes start like no type this checks, which a text file does.
pub fn matches(&self, start: &[u8]) -> bool
Sourcepub fn served(&self) -> (&str, Disposition)
pub fn served(&self) -> (&str, Disposition)
How a download is sent: its type, and inline only when that cannot run as a page.
Trait Implementations§
Source§impl Clone for ContentType
impl Clone for ContentType
Source§impl Debug for ContentType
impl Debug for ContentType
Source§impl<'de> Deserialize<'de> for ContentType
impl<'de> Deserialize<'de> for ContentType
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 ContentType
impl Display for ContentType
impl Eq for ContentType
Source§impl Hash for ContentType
impl Hash for ContentType
Source§impl PartialEq for ContentType
impl PartialEq for ContentType
Source§impl Serialize for ContentType
impl Serialize for ContentType
impl StructuralPartialEq for ContentType
Auto Trait Implementations§
impl Freeze for ContentType
impl RefUnwindSafe for ContentType
impl Send for ContentType
impl Sync for ContentType
impl Unpin for ContentType
impl UnsafeUnpin for ContentType
impl UnwindSafe for ContentType
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
Source§impl<V> Cast for Vwhere
V: Value,
impl<V> Cast for Vwhere
V: Value,
const COLUMNS: &'static [ColumnSpec] = <V::Inner>::COLUMNS
const NULLABLE: bool = <V::Inner>::NULLABLE
Source§const SENSITIVE: bool
const SENSITIVE: bool
A field holding it is never filtered, sorted, listed or searched, as
#[sensitive] ones.fn encode(&self, out: &mut Vec<SqlValue>)
fn decode(row: &mut dyn ColumnReader) -> Result<V, Error>
Source§const MOVES: Option<fn(&Self) -> Option<&'static Targets>> = None
const MOVES: Option<fn(&Self) -> Option<&'static Targets>> = None
Set for a value moving between listed states; a save of any other value skips the check.
Source§const HOLDS_STATES: bool = _
const HOLDS_STATES: bool = _
Set when a state anywhere in the value is checked on save, as a field’s of several.
fn refuse_unlisted_move( field: &str, stored: &Self, current: &Self, ) -> Result<(), Error>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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§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.