pub struct Dictionary { /* private fields */ }Expand description
Stores a dictionary of resources, generally added via embedded_resource! and link_resource! macros.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn new() -> Dictionary
pub fn new() -> Dictionary
Create a new, empty dictionary.
Sourcepub fn get_resource(&self, path: String) -> Option<&'static [u8]>
pub fn get_resource(&self, path: String) -> Option<&'static [u8]>
Request a resource, returning either a byte array or None.
Sourcepub fn add_resource(&mut self, path: String, bytes: &'static [u8])
pub fn add_resource(&mut self, path: String, bytes: &'static [u8])
Insert a resource into the dictionary.
Trait Implementations§
Source§impl Default for Dictionary
impl Default for Dictionary
Source§fn default() -> Dictionary
fn default() -> Dictionary
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Dictionary
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnwindSafe for Dictionary
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