[][src]Struct canvas::ReuseError

pub struct ReuseError { /* fields omitted */ }

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

impl Debug for ReuseError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.