Struct winrt::IMemoryBufferByteAccess
source · #[repr(C)]pub struct IMemoryBufferByteAccess { /* private fields */ }
Expand description
Provides direct byte access to the memory buffer underlying an IMemoryBuffer
.
Implementations§
source§impl IMemoryBufferByteAccess
impl IMemoryBufferByteAccess
sourcepub unsafe fn get_buffer(&self) -> &[u8] ⓘ
pub unsafe fn get_buffer(&self) -> &[u8] ⓘ
Provides direct byte access to the memory buffer underlying an IMemoryBuffer
.
To use IMemoryBufferByteAccess
, you first need to obtain an IMemoryBufferReference
, then
call query_interface::<IMemoryBufferByteAccess>()
on that.
This method is marked unsafe
, because the buffer might be invalidated during its lifetime.
Due to the nature of COM objects, the buffer might be referenced and modified or closed
by some other instance, which Rust’s type system cannot know about. The Close
event on
IMemoryBufferReference
can be used to be notified when the buffer is closed.
An empty slice is returned if the underlying buffer has already been closed.