[−][src]Struct canvas::ReuseError
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 pixel type.
let mut rec = Rec::<u16>::new(16); let err = match rec.reuse(rec.capacity() + 1) { Ok(_) => unreachable!("Increasing capacity would require reallocation"), Err(err) => err, }; let err = match rec.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 RefUnwindSafe for ReuseError
impl Send for ReuseError
impl Sync for ReuseError
impl Unpin for ReuseError
impl UnwindSafe for ReuseError
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,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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.
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>,