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 for Clamped<T>where
T: FromWasmAbi,
impl<T> FromWasmAbi for Clamped<T>where
T: FromWasmAbi,
source§impl<T> IntoWasmAbi for Clamped<T>where
T: IntoWasmAbi,
impl<T> IntoWasmAbi for Clamped<T>where
T: IntoWasmAbi,
impl<T> Copy for Clamped<T>where
T: Copy,
impl<T> Eq for Clamped<T>where
T: Eq,
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§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,
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
.