pub struct WebpBox<T: ?Sized> { /* private fields */ }
Expand description
A safe RAII wrapper for WebPFree
.
WebpBox
is much like Box
, except what function is used for freeing.
The main usecase is as a return value from libwebp.
use libwebp::WebPEncodeRGBA;
let buf: &[u8];
let data = WebPEncodeRGBA(buf, 2, 2, 8, 75.0).unwrap();
Creates WebpBox
from a raw pointer.
raw
must be non-null.
raw
must be well-aligned.
- The pointee must be valid as
T
.
- The pointee must be exclusively accessible.
raw
must be freeable via WebPFree
.
Turns WebpBox
into a raw pointer without freeing anything.
Formats the value using the given formatter.
Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Executes the destructor for this type.
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.