pub struct CFileBuffer { /* private fields */ }Expand description
A C-compatible memory-backed file buffer.
This struct wraps a FILE* created via fmemopen, allowing FFI functions
to write to a memory buffer that can then be read from Rust.
Implementations§
Source§impl CFileBuffer
impl CFileBuffer
Sourcepub fn new(max_size: usize) -> Result<Self, &'static str>
pub fn new(max_size: usize) -> Result<Self, &'static str>
Create a new CFileBuffer object with a buffer of max_size.
Sourcepub fn file(&mut self) -> CFilePtr<'_>
pub fn file(&mut self) -> CFilePtr<'_>
Get the raw FILE pointer wrapper.
This mutably borrows self, ensuring no other borrows (like data())
can exist while this wrapper is alive.
Trait Implementations§
Source§impl Drop for CFileBuffer
impl Drop for CFileBuffer
impl Send for CFileBuffer
Auto Trait Implementations§
impl Freeze for CFileBuffer
impl RefUnwindSafe for CFileBuffer
impl !Sync for CFileBuffer
impl Unpin for CFileBuffer
impl UnsafeUnpin for CFileBuffer
impl UnwindSafe for CFileBuffer
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