Enum veloren_common_assets::source::DirEntry
pub enum DirEntry<'a> {
File(&'a str, &'a str),
Directory(&'a str),
}
Expand description
An entry in a source.
Variants§
File(&'a str, &'a str)
A file with an id and an extension.
Directory(&'a str)
A directory with an id.
Implementations§
§impl<'a> DirEntry<'a>
impl<'a> DirEntry<'a>
pub fn parent_id(self) -> Option<&'a str>
pub fn parent_id(self) -> Option<&'a str>
Returns the entry’s parent’s id, or None
if it is the root.
§Example
use assets_manager::source::DirEntry;
let entry = DirEntry::File("example.hello.world", "txt");
assert_eq!(entry.parent_id(), Some("example.hello"));
let root = DirEntry::Directory("");
assert!(root.parent_id().is_none());
Trait Implementations§
§impl<'a> PartialEq for DirEntry<'a>
impl<'a> PartialEq for DirEntry<'a>
impl<'a> Copy for DirEntry<'a>
impl<'a> Eq for DirEntry<'a>
impl<'a> StructuralPartialEq for DirEntry<'a>
Auto Trait Implementations§
impl<'a> Freeze for DirEntry<'a>
impl<'a> RefUnwindSafe for DirEntry<'a>
impl<'a> Send for DirEntry<'a>
impl<'a> Sync for DirEntry<'a>
impl<'a> Unpin for DirEntry<'a>
impl<'a> UnwindSafe for DirEntry<'a>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more