[−][src]Struct libwebp::boxed::WebpBox
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();
Methods
impl<T: ?Sized> WebpBox<T>
[src]
pub unsafe fn from_raw(raw: *mut T) -> WebpBox<T>
[src]
Creates WebpBox
from a raw pointer.
Safety
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 viaWebPFree
.
pub fn into_raw(b: WebpBox<T>) -> *mut T
[src]
Turns WebpBox
into a raw pointer without freeing anything.
Trait Implementations
impl<T: Debug + ?Sized> Debug for WebpBox<T>
[src]
impl<T: ?Sized> Deref for WebpBox<T>
[src]
impl<T: ?Sized> DerefMut for WebpBox<T>
[src]
impl<T: ?Sized> Drop for WebpBox<T>
[src]
impl<T: ?Sized + RefUnwindSafe> RefUnwindSafe for WebpBox<T>
[src]
impl<T: ?Sized + Send> Send for WebpBox<T>
[src]
impl<T: ?Sized + Sync> Sync for WebpBox<T>
[src]
impl<T: ?Sized + UnwindSafe> UnwindSafe for WebpBox<T>
[src]
Auto Trait Implementations
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>,