Struct checked_array::Preallocated [−][src]
A wrapper that implements CanAlloc
over a preallocated buffer
Implementations
impl<Buffer> Preallocated<Buffer>
[src]
pub const fn new(buffer: Buffer) -> Self
[src]
Create a new Preallocated
instance by wrapping buffer
pub const fn new_with_used(buffer: Buffer, used: usize) -> Self
[src]
Create a new Preallocated
instance by wrapping buffer
and sets the amount of used bytes to used
Discussion: If used
is greated than buffer.len()
, it will be silently capped to buffer.len()
wherever
necessary
pub fn into_inner(self) -> Buffer
[src]
Returns the wrapped buffer
Trait Implementations
impl<Buffer, T> AsMut<[T]> for Preallocated<Buffer> where
Buffer: AsMut<[T]>,
[src]
Buffer: AsMut<[T]>,
impl<Buffer, T> AsRef<[T]> for Preallocated<Buffer> where
Buffer: AsRef<[T]>,
[src]
Buffer: AsRef<[T]>,
Auto Trait Implementations
impl<Buffer> RefUnwindSafe for Preallocated<Buffer> where
Buffer: RefUnwindSafe,
Buffer: RefUnwindSafe,
impl<Buffer> Send for Preallocated<Buffer> where
Buffer: Send,
Buffer: Send,
impl<Buffer> Sync for Preallocated<Buffer> where
Buffer: Sync,
Buffer: Sync,
impl<Buffer> Unpin for Preallocated<Buffer> where
Buffer: Unpin,
Buffer: Unpin,
impl<Buffer> UnwindSafe for Preallocated<Buffer> where
Buffer: UnwindSafe,
Buffer: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,