pub struct Clamped<T>(pub T);Expand description
A wrapper type around slices and vectors for binding the Uint8ClampedArray in JS.
Supported inner types:
Clamped<&[u8]>Clamped<&mut [u8]>Clamped<Vec<u8>>
Tuple Fields§
§0: TTrait Implementations§
Source§impl BinaryDecode for Clamped<Vec<u8>>
impl BinaryDecode for Clamped<Vec<u8>>
fn decode( decoder: &mut DecodedData<'_>, ) -> Result<Clamped<Vec<u8>>, DecodeError>
Source§impl BinaryEncode for Clamped<&[u8]>
impl BinaryEncode for Clamped<&[u8]>
fn encode(self, encoder: &mut EncodedData)
Source§impl BinaryEncode for Clamped<&mut [u8]>
impl BinaryEncode for Clamped<&mut [u8]>
fn encode(self, encoder: &mut EncodedData)
Source§impl BinaryEncode for Clamped<Vec<u8>>
impl BinaryEncode for Clamped<Vec<u8>>
fn encode(self, encoder: &mut EncodedData)
Source§impl EncodeTypeDef for Clamped<&[u8]>
impl EncodeTypeDef for Clamped<&[u8]>
Source§fn encode_type_def(buf: &mut Vec<u8>)
fn encode_type_def(buf: &mut Vec<u8>)
Encode this type’s definition into the buffer.
For primitives, this is just the TypeTag byte.
For callbacks, this includes param count, param types, and return type.
Source§impl EncodeTypeDef for Clamped<&mut [u8]>
impl EncodeTypeDef for Clamped<&mut [u8]>
Source§fn encode_type_def(buf: &mut Vec<u8>)
fn encode_type_def(buf: &mut Vec<u8>)
Encode this type’s definition into the buffer.
For primitives, this is just the TypeTag byte.
For callbacks, this includes param count, param types, and return type.
Source§impl EncodeTypeDef for Clamped<Vec<u8>>
impl EncodeTypeDef for Clamped<Vec<u8>>
Source§fn encode_type_def(buf: &mut Vec<u8>)
fn encode_type_def(buf: &mut Vec<u8>)
Encode this type’s definition into the buffer.
For primitives, this is just the TypeTag byte.
For callbacks, this includes param count, param types, and return type.
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