pub struct BytesResource { /* private fields */ }Expand description
This struct is a pointer to a memory chunk or slice.
Implementations§
Source§impl BytesResource
impl BytesResource
Sourcepub fn get_write_ptr_and_length(&self) -> (*mut u8, usize)
pub fn get_write_ptr_and_length(&self) -> (*mut u8, usize)
Returns a mutable pointer to the start of the resource and its length.
Sourcepub fn write<'a>(&mut self) -> &'a mut [u8] ⓘ
pub fn write<'a>(&mut self) -> &'a mut [u8] ⓘ
Returns the resource as a mutable slice of bytes.
The lifetime 'a is the lifetime of the underlying BytesStorage allocation,
not of self. The &mut self ensures only one mutable slice is created per
resource. Multiple resources may point to non-overlapping regions of the same
allocation (like split_at_mut); each resource owns its region exclusively.
Trait Implementations§
Source§impl Debug for BytesResource
impl Debug for BytesResource
impl Send for BytesResource
Auto Trait Implementations§
impl Freeze for BytesResource
impl RefUnwindSafe for BytesResource
impl !Sync for BytesResource
impl Unpin for BytesResource
impl UnsafeUnpin for BytesResource
impl UnwindSafe for BytesResource
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