pub struct Loader<'a> { /* private fields */ }Expand description
Decodes one model’s textures: looks pictures up next to the model,
keeps the decoded total within BUDGET and decodes each file or
embedded picture once.
Implementations§
Source§impl<'a> Loader<'a>
impl<'a> Loader<'a>
pub fn new(side: Side<'a>) -> Loader<'a>
Sourcepub fn with_budget(side: Side<'a>, budget: usize) -> Loader<'a>
pub fn with_budget(side: Side<'a>, budget: usize) -> Loader<'a>
A loader with its own byte budget.
Sourcepub fn for_map<T>(&mut self, read: impl FnOnce(&mut Self) -> T) -> T
pub fn for_map<T>(&mut self, read: impl FnOnce(&mut Self) -> T) -> T
Runs read, a read of a normal, bump or emissive map: it may take
only half of the bytes still free.
Sourcepub fn file(&mut self, path: &str) -> Option<Arc<Image>>
pub fn file(&mut self, path: &str) -> Option<Arc<Image>>
The picture a model names by path (see candidates).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Loader<'a>
impl<'a> !Send for Loader<'a>
impl<'a> !Sync for Loader<'a>
impl<'a> !UnwindSafe for Loader<'a>
impl<'a> Freeze for Loader<'a>
impl<'a> Unpin for Loader<'a>
impl<'a> UnsafeUnpin for Loader<'a>
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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