pub struct RawResource { /* private fields */ }
Expand description
Represents a raw handle to a embed resource. Manipulating raw resources is inherently unsafe.
RawResources
are loaded using EmbedResource::raw
and EmbedResource::raw_str
In order to access the raw resource data use as_mut_ptr()
or as_mut_slice()
and cast the pointer to your data type.
Implementations§
Source§impl RawResource
impl RawResource
Sourcepub fn data_handle(&self) -> HGLOBAL
pub fn data_handle(&self) -> HGLOBAL
Returns the system handle for the resource data
Sourcepub fn resource_type(&self) -> RawResourceType
pub fn resource_type(&self) -> RawResourceType
Returns the resource type set during texture loading
Sourcepub unsafe fn as_mut_ptr(&mut self) -> *mut c_void
pub unsafe fn as_mut_ptr(&mut self) -> *mut c_void
Return a const pointer to the resource.
Sourcepub unsafe fn as_mut_slice(&self) -> &mut [u8] ⓘ
pub unsafe fn as_mut_slice(&self) -> &mut [u8] ⓘ
Return the resource data as a byte slice. This is equivalent to using slice::from_raw_parts_mut
Auto Trait Implementations§
impl Freeze for RawResource
impl RefUnwindSafe for RawResource
impl !Send for RawResource
impl !Sync for RawResource
impl Unpin for RawResource
impl UnwindSafe for RawResource
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