pub struct Assets { /* private fields */ }Implementations§
Source§impl Assets
impl Assets
Sourcepub fn new(root: impl AsRef<Path>) -> Result<Self>
pub fn new(root: impl AsRef<Path>) -> Result<Self>
Create with root as the asset directory. Path is canonicalized eagerly to make
matching against notify events deterministic.
pub fn root(&self) -> &Path
pub fn resolve(&self, rel: impl AsRef<Path>) -> PathBuf
pub fn read(&self, rel: impl AsRef<Path>) -> Result<Vec<u8>>
Sourcepub fn drain_changes(&mut self) -> Vec<PathBuf>
pub fn drain_changes(&mut self) -> Vec<PathBuf>
Drain all queued filesystem changes since last call. Paths are canonicalized when possible. Idempotent across re-saves within one frame (HashSet-deduped).
Auto Trait Implementations§
impl Freeze for Assets
impl RefUnwindSafe for Assets
impl Send for Assets
impl !Sync for Assets
impl Unpin for Assets
impl UnsafeUnpin for Assets
impl UnwindSafe for Assets
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