pub struct Resource {
pub kind: Id,
pub name: Id,
pub lang: u16,
pub encoded: Arc<Mutex<Vec<u8>>>,
pub decoded: Arc<Mutex<Option<ResourceData>>>,
/* private fields */
}Expand description
Structure representing a single resource
Fields§
§kind: Idresource type
name: Idresource name
lang: u16u16 language associated with the resource
encoded: Arc<Mutex<Vec<u8>>>raw resource data
decoded: Arc<Mutex<Option<ResourceData>>>destructured resource data (not implemented)
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn new(
resources: &Resources,
rtype: PCSTR,
rname: PCSTR,
rlang: u16,
data: &[u8],
) -> Resource
pub fn new( resources: &Resources, rtype: PCSTR, rname: PCSTR, rlang: u16, data: &[u8], ) -> Resource
Create a new resource instance bound to the Resources resource manager.
Sourcepub fn remove(&self) -> Result<&Self, Error>
pub fn remove(&self) -> Result<&Self, Error>
Remove resource from the associated module (deletes the resource)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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