#[repr(C)]pub struct RawBuf<T> { /* private fields */ }Implementations§
source§impl<T> RawBuf<T>
impl<T> RawBuf<T>
pub const fn dangling() -> Self
pub fn new(capacity: usize) -> (Self, usize)
sourcepub unsafe fn dealloc(self, len: usize) -> Result<Self, InvalidArgumentError>
pub unsafe fn dealloc(self, len: usize) -> Result<Self, InvalidArgumentError>
Deallocates the buffer. Returns InvalidArgumentError if len is impossibly big.
Safety
lenmust be the exact length of the allocated object, using the value returned withRawBuf::new() -> (_, len)will guarantee safety.- this must be the first time that you call this function (aka self.data cannot be dangling)
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for RawBuf<T>where
T: RefUnwindSafe,
impl<T> !Send for RawBuf<T>
impl<T> !Sync for RawBuf<T>
impl<T> Unpin for RawBuf<T>
impl<T> UnwindSafe for RawBuf<T>where
T: RefUnwindSafe,
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