pub enum OptionalEntry {
#[non_exhaustive] File {
uri: Option<FileUri>,
name: Option<String>,
last_modified: Option<SystemTime>,
len: Option<u64>,
mime_type: Option<String>,
},
#[non_exhaustive] Dir {
uri: Option<FileUri>,
name: Option<String>,
last_modified: Option<SystemTime>,
},
}Variants§
#[non_exhaustive]File
Fields
This variant is marked as non-exhaustive
last_modified: Option<SystemTime>If EntryOptions { last_modified, .. } is set to true,
this will never be None.
#[non_exhaustive]Dir
Fields
This variant is marked as non-exhaustive
last_modified: Option<SystemTime>If EntryOptions { last_modified, .. } is set to true,
this will never be None.
Implementations§
Source§impl OptionalEntry
impl OptionalEntry
pub fn is_file(&self) -> bool
pub fn is_dir(&self) -> bool
Sourcepub fn into_uri(self) -> Option<FileUri>
pub fn into_uri(self) -> Option<FileUri>
If EntryOptions { uri, .. } is set to true,
this will never be None.
Sourcepub fn into_uri_or_err(self) -> Result<FileUri>
pub fn into_uri_or_err(self) -> Result<FileUri>
If EntryOptions { uri, .. } is set to true,
this will never be error.
Sourcepub fn uri_or_err(&self) -> Result<&FileUri>
pub fn uri_or_err(&self) -> Result<&FileUri>
If EntryOptions { uri, .. } is set to true,
this will never be error.
Sourcepub fn name_or_err(&self) -> Result<&str>
pub fn name_or_err(&self) -> Result<&str>
If EntryOptions { name, .. } is set to true,
this will never be error.
Sourcepub fn last_modified_or_err(&self) -> Result<SystemTime>
pub fn last_modified_or_err(&self) -> Result<SystemTime>
If EntryOptions { last_modified, .. } is set to true,
this will never be error.
Sourcepub fn file_mime_type_or_err(&self) -> Result<&str>
pub fn file_mime_type_or_err(&self) -> Result<&str>
If a file and EntryOptions { mime_type, .. } is set to true,
this will never be error.
Sourcepub fn file_len_or_err(&self) -> Result<u64>
pub fn file_len_or_err(&self) -> Result<u64>
If a file and EntryOptions { len, .. } is set to true,
this will never be error.
Sourcepub fn uri(&self) -> Option<&FileUri>
pub fn uri(&self) -> Option<&FileUri>
If EntryOptions { uri, .. } is set to true,
this will never be None.
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
If EntryOptions { name, .. } is set to true,
this will never be None.
Sourcepub fn last_modified(&self) -> Option<SystemTime>
pub fn last_modified(&self) -> Option<SystemTime>
If EntryOptions { last_modified, .. } is set to true,
this will never be None.
Sourcepub fn file_mime_type(&self) -> Option<&str>
pub fn file_mime_type(&self) -> Option<&str>
If a file and EntryOptions { mime_type, .. } is set to true,
this will never be None.
Trait Implementations§
Source§impl Clone for OptionalEntry
impl Clone for OptionalEntry
Source§fn clone(&self) -> OptionalEntry
fn clone(&self) -> OptionalEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OptionalEntry
impl Debug for OptionalEntry
Source§impl<'de> Deserialize<'de> for OptionalEntry
impl<'de> Deserialize<'de> for OptionalEntry
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>,
impl Eq for OptionalEntry
Source§impl Hash for OptionalEntry
impl Hash for OptionalEntry
Source§impl PartialEq for OptionalEntry
impl PartialEq for OptionalEntry
Source§fn eq(&self, other: &OptionalEntry) -> bool
fn eq(&self, other: &OptionalEntry) -> bool
self and other values to be equal, and is used by ==.