pub struct BufferReuseError { /* private fields */ }
Expand description
Error representation for a failed buffer reuse.
Indicates that the capacity of the underlying buffer is not large enough to perform the operation without a reallocation. This may be either since the allocation is simply not large enough or due to the requested length not having any representation in memory for the chosen texel type.
let mut buffer = TexelBuffer::<u16>::new(16);
let err = match buffer.reuse(buffer.capacity() + 1) {
Ok(_) => unreachable!("Increasing capacity would require reallocation"),
Err(err) => err,
};
let err = match buffer.reuse(usize::max_value()) {
Ok(_) => unreachable!("A slice of u16 can never have usize::MAX elements"),
Err(err) => err,
};
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferReuseError
impl RefUnwindSafe for BufferReuseError
impl Send for BufferReuseError
impl Sync for BufferReuseError
impl Unpin for BufferReuseError
impl UnwindSafe for BufferReuseError
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