pub struct AsMutBuffer<B>(/* private fields */);
Expand description
Implementations§
Source§impl<B> AsMutBuffer<B>
impl<B> AsMutBuffer<B>
Sourcepub unsafe fn new(buffer: B) -> Self
pub unsafe fn new(buffer: B) -> Self
Creates a new AsMutBuffer
from a given buffer.
§SAFETY
If buffer implements AsMut<S>
and AsRef<S>
, then both operations must return the same
slice. If B
implements BorrowMetadata
, then borrow_metadata
must not invalidate
the buffer slice.
Sourcepub fn into_inner(self) -> B
pub fn into_inner(self) -> B
Returns the inner buffer.
Trait Implementations§
Source§impl<B: BorrowMetadata> BorrowMetadata for AsMutBuffer<B>
impl<B: BorrowMetadata> BorrowMetadata for AsMutBuffer<B>
Source§type Metadata = <B as BorrowMetadata>::Metadata
type Metadata = <B as BorrowMetadata>::Metadata
The metadata borrowed.
Source§fn borrow_metadata(&self) -> &Self::Metadata
fn borrow_metadata(&self) -> &Self::Metadata
Borrow the metadata.
Source§impl<S: Slice + ?Sized, B: AsRef<S> + AsMut<S> + Send + Sync + 'static> BufferMut<S> for AsMutBuffer<B>
SAFETY: Trait contract is upheld by AsMutBuffer::new
contract.
impl<S: Slice + ?Sized, B: AsRef<S> + AsMut<S> + Send + Sync + 'static> BufferMut<S> for AsMutBuffer<B>
SAFETY: Trait contract is upheld by AsMutBuffer::new
contract.
Source§fn as_mut_slice(&mut self) -> &mut S
fn as_mut_slice(&mut self) -> &mut S
Returns the mutable buffer slice.
Source§unsafe fn set_len(&mut self, _len: usize) -> bool
unsafe fn set_len(&mut self, _len: usize) -> bool
Set the length of the buffer slice. Read more
Source§fn try_reserve(&mut self, _additional: usize) -> Result<(), TryReserveError>
fn try_reserve(&mut self, _additional: usize) -> Result<(), TryReserveError>
Tries reserving capacity for at least
additional
items.Source§impl<B: Clone> Clone for AsMutBuffer<B>
impl<B: Clone> Clone for AsMutBuffer<B>
Source§fn clone(&self) -> AsMutBuffer<B>
fn clone(&self) -> AsMutBuffer<B>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<B: Debug> Debug for AsMutBuffer<B>
impl<B: Debug> Debug for AsMutBuffer<B>
Source§impl<B> Deref for AsMutBuffer<B>
impl<B> Deref for AsMutBuffer<B>
Auto Trait Implementations§
impl<B> Freeze for AsMutBuffer<B>where
B: Freeze,
impl<B> RefUnwindSafe for AsMutBuffer<B>where
B: RefUnwindSafe,
impl<B> Send for AsMutBuffer<B>where
B: Send,
impl<B> Sync for AsMutBuffer<B>where
B: Sync,
impl<B> Unpin for AsMutBuffer<B>where
B: Unpin,
impl<B> UnwindSafe for AsMutBuffer<B>where
B: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more