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.
§Example
The main usecase is as a return value from libwebp.
use libwebp::WebPEncodeRGBA;
let buf: &[u8];
// This variable has the type of `WebpBox<[u8]>`.
let data = WebPEncodeRGBA(buf, 2, 2, 8, 75.0).unwrap();Implementations§
Trait Implementations§
impl<T: ?Sized + RefUnwindSafe> RefUnwindSafe for WebpBox<T>
impl<T: ?Sized + Send> Send for WebpBox<T>
impl<T: ?Sized + Sync> Sync for WebpBox<T>
impl<T: ?Sized + UnwindSafe> UnwindSafe for WebpBox<T>
Auto Trait Implementations§
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