Struct wasm_bindgen::Clamped
source · pub struct Clamped<T>(pub T);
Expand description
A wrapper type around slices and vectors for binding the Uint8ClampedArray
array in JS.
If you need to invoke a JS API which must take Uint8ClampedArray
array,
then you can define it as taking one of these types:
Clamped<&[u8]>
Clamped<&mut [u8]>
Clamped<Vec<u8>>
All of these types will show up as Uint8ClampedArray
in JS and will have
different forms of ownership in Rust.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: FromWasmAbi> FromWasmAbi for Clamped<T>
impl<T: FromWasmAbi> FromWasmAbi for Clamped<T>
source§impl<T: IntoWasmAbi> IntoWasmAbi for Clamped<T>
impl<T: IntoWasmAbi> IntoWasmAbi for Clamped<T>
impl<T: Copy> Copy for Clamped<T>
impl<T: Eq> Eq for Clamped<T>
impl<T> StructuralPartialEq for Clamped<T>
Auto Trait Implementations§
impl<T> Freeze for Clamped<T>where
T: Freeze,
impl<T> RefUnwindSafe for Clamped<T>where
T: RefUnwindSafe,
impl<T> Send for Clamped<T>where
T: Send,
impl<T> Sync for Clamped<T>where
T: Sync,
impl<T> Unpin for Clamped<T>where
T: Unpin,
impl<T> UnwindSafe for Clamped<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.