pub struct AssetPath { /* private fields */ }Expand description
Where a file is: its path in the bundle (relative to a layer’s root,
/-separated), and the name errors show it by (base/images/a.png).
Implementations§
Source§impl AssetPath
impl AssetPath
Sourcepub fn in_bundle(bundle: &Bundle, path: &str) -> Self
pub fn in_bundle(bundle: &Bundle, path: &str) -> Self
The file at path in bundle, shown as the bundle shows it
(Bundle::display_path).
Sourcepub fn dir(&self) -> &str
pub fn dir(&self) -> &str
The directory it is in: what comes before the last /, or "" at
the root.
Sourcepub fn extension(&self) -> Option<&str>
pub fn extension(&self) -> Option<&str>
Its extension as written (in any case), without the dot: what
follows the last . of its name, when something comes before it.
Sourcepub fn with_extension(&self, extension: &str) -> String
pub fn with_extension(&self, extension: &str) -> String
The path of the file beside this one with its stem and the
extension extension (atlas.ron → atlas.png).
Trait Implementations§
impl Eq for AssetPath
Source§impl Ord for AssetPath
impl Ord for AssetPath
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for AssetPath
impl PartialOrd for AssetPath
impl StructuralPartialEq for AssetPath
Auto Trait Implementations§
impl Freeze for AssetPath
impl RefUnwindSafe for AssetPath
impl Send for AssetPath
impl Sync for AssetPath
impl Unpin for AssetPath
impl UnsafeUnpin for AssetPath
impl UnwindSafe for AssetPath
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