pub struct ResourceManager { /* private fields */ }
Implementations§
Source§impl ResourceManager
impl ResourceManager
Sourcepub fn new<L: ImageLoader + 'static, P: Provider + 'static>(
image_loader: L,
file_provider: P,
) -> Self
pub fn new<L: ImageLoader + 'static, P: Provider + 'static>( image_loader: L, file_provider: P, ) -> Self
Create a new resource manager with a given image loader and data provider.
Defaults the base path to the current directory (.
).
pub fn load_image(&mut self, path: &str) -> Result<Rc<dyn Any>>
pub fn load_object_template(&mut self, relpath: &str) -> Result<Object>
pub fn load_text(&mut self, path: &str) -> Result<String>
Sourcepub fn set_base_path(&mut self, base_path: String)
pub fn set_base_path(&mut self, base_path: String)
Set the resource manager’s base path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceManager
impl !RefUnwindSafe for ResourceManager
impl !Send for ResourceManager
impl !Sync for ResourceManager
impl Unpin for ResourceManager
impl !UnwindSafe for ResourceManager
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