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§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§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
.