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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.