We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e42ad0 commit 4f0c7a2Copy full SHA for 4f0c7a2
api/src/info.rs
@@ -186,6 +186,14 @@ impl FrameBuffer {
186
unsafe { self.create_buffer_mut() }
187
}
188
189
+ /// Converts the frame buffer to a raw byte slice.
190
+ ///
191
+ /// The same as `buffer_mut()` but takes the ownership and returns the
192
+ /// mutable buffer with a `'static` lifetime.
193
+ pub fn into_buffer(self) -> &'static mut [u8] {
194
+ unsafe { self.create_buffer_mut() }
195
+ }
196
+
197
unsafe fn create_buffer<'a>(&self) -> &'a [u8] {
198
unsafe { slice::from_raw_parts(self.buffer_start as *const u8, self.info.byte_len) }
199
0 commit comments