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 · 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>,
Source§impl Hash for OptionalEntry
impl Hash for OptionalEntry
Source§impl PartialEq for OptionalEntry
impl PartialEq for OptionalEntry
Source§impl Serialize for OptionalEntry
impl Serialize for OptionalEntry
Source§impl TryFrom<OptionalEntry> for Entry
impl TryFrom<OptionalEntry> for Entry
impl Eq for OptionalEntry
impl StructuralPartialEq for OptionalEntry
Auto Trait Implementations§
impl Freeze for OptionalEntry
impl RefUnwindSafe for OptionalEntry
impl Send for OptionalEntry
impl Sync for OptionalEntry
impl Unpin for OptionalEntry
impl UnwindSafe for OptionalEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
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
key and return true if they are equal.