Struct bones_asset::FileAssetIo
source · pub struct FileAssetIo {
pub core_dir: PathBuf,
pub packs_dir: PathBuf,
pub watcher: Mutex<Option<Box<dyn Watcher + Sync + Send>>>,
}
Expand description
AssetIo
implementation that loads from the filesystem.
Fields§
§core_dir: PathBuf
The directory to load the core asset pack.
packs_dir: PathBuf
The directory to load the asset packs from.
watcher: Mutex<Option<Box<dyn Watcher + Sync + Send>>>
Filesystem watcher if enabled.
Implementations§
source§impl FileAssetIo
impl FileAssetIo
sourcepub fn new(core_dir: &Path, packs_dir: &Path) -> Self
pub fn new(core_dir: &Path, packs_dir: &Path) -> Self
Create a new FileAssetIo
.
Trait Implementations§
source§impl AssetIo for FileAssetIo
impl AssetIo for FileAssetIo
source§fn enumerate_packs(&self) -> BoxedFuture<Result<Vec<String>>>
fn enumerate_packs(&self) -> BoxedFuture<Result<Vec<String>>>
List the names of the non-core asset pack folders that are installed. Read more
source§fn load_file(&self, loc: AssetLocRef<'_>) -> BoxedFuture<Result<Vec<u8>>>
fn load_file(&self, loc: AssetLocRef<'_>) -> BoxedFuture<Result<Vec<u8>>>
Get the binary contents of an asset. Read more
Auto Trait Implementations§
impl !Freeze for FileAssetIo
impl !RefUnwindSafe for FileAssetIo
impl Send for FileAssetIo
impl Sync for FileAssetIo
impl Unpin for FileAssetIo
impl !UnwindSafe for FileAssetIo
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