Struct Take
pub struct Take<T> {
inner: T,
limit: usize,
}
Expand description
A Buf
adapter which limits the bytes read from an underlying buffer.
This struct is generally created by calling take()
on Buf
. See
documentation of take()
for more details.
Fieldsยง
ยงinner: T
ยงlimit: usize
Implementationsยง
ยงimpl<T> Take<T>
impl<T> Take<T>
pub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes this Take
, returning the underlying value.
ยงExamples
use bytes::{Buf, BufMut};
let mut buf = b"hello world".take(2);
let mut dst = vec![];
dst.put(&mut buf);
assert_eq!(*dst, b"he"[..]);
let mut buf = buf.into_inner();
dst.clear();
dst.put(&mut buf);
assert_eq!(*dst, b"llo world"[..]);
pub fn get_ref(&self) -> &T
pub fn get_ref(&self) -> &T
Gets a reference to the underlying Buf
.
It is inadvisable to directly read from the underlying Buf
.
ยงExamples
use bytes::Buf;
let buf = b"hello world".take(2);
assert_eq!(11, buf.get_ref().remaining());
pub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Gets a mutable reference to the underlying Buf
.
It is inadvisable to directly read from the underlying Buf
.
ยงExamples
use bytes::{Buf, BufMut};
let mut buf = b"hello world".take(2);
let mut dst = vec![];
buf.get_mut().advance(2);
dst.put(&mut buf);
assert_eq!(*dst, b"ll"[..]);
pub fn limit(&self) -> usize
pub fn limit(&self) -> usize
Returns the maximum number of bytes that can be read.
ยงNote
If the inner Buf
has fewer bytes than indicated by this method then
that is the actual number of available bytes.
ยงExamples
use bytes::Buf;
let mut buf = b"hello world".take(2);
assert_eq!(2, buf.limit());
assert_eq!(b'h', buf.get_u8());
assert_eq!(1, buf.limit());
pub fn set_limit(&mut self, lim: usize)
pub fn set_limit(&mut self, lim: usize)
Sets the maximum number of bytes that can be read.
ยงNote
If the inner Buf
has fewer bytes than lim
then that is the actual
number of available bytes.
ยงExamples
use bytes::{Buf, BufMut};
let mut buf = b"hello world".take(2);
let mut dst = vec![];
dst.put(&mut buf);
assert_eq!(*dst, b"he"[..]);
dst.clear();
buf.set_limit(3);
dst.put(&mut buf);
assert_eq!(*dst, b"llo"[..]);
Trait Implementationsยง
ยงimpl<T> Buf for Take<T>where
T: Buf,
impl<T> Buf for Take<T>where
T: Buf,
ยงfn remaining(&self) -> usize
fn remaining(&self) -> usize
Returns the number of bytes between the current position and the end of
the buffer. Read more
ยงfn chunk(&self) -> &[u8] โ
fn chunk(&self) -> &[u8] โ
Returns a slice starting at the current position and of length between 0
and
Buf::remaining()
. Note that this can return a shorter slice (this
allows non-continuous internal representation). Read moreยงfn copy_to_bytes(&mut self, len: usize) -> Bytes
fn copy_to_bytes(&mut self, len: usize) -> Bytes
ยงfn chunks_vectored<'a>(&'a self, dst: &mut [IoSlice<'a>]) -> usize
fn chunks_vectored<'a>(&'a self, dst: &mut [IoSlice<'a>]) -> usize
ยงfn has_remaining(&self) -> bool
fn has_remaining(&self) -> bool
Returns true if there are any more bytes to consume Read more
ยงfn copy_to_slice(&mut self, dst: &mut [u8])
fn copy_to_slice(&mut self, dst: &mut [u8])
ยงfn get_u16(&mut self) -> u16
fn get_u16(&mut self) -> u16
Gets an unsigned 16 bit integer from
self
in big-endian byte order. Read moreยงfn get_u16_le(&mut self) -> u16
fn get_u16_le(&mut self) -> u16
Gets an unsigned 16 bit integer from
self
in little-endian byte order. Read moreยงfn get_u16_ne(&mut self) -> u16
fn get_u16_ne(&mut self) -> u16
Gets an unsigned 16 bit integer from
self
in native-endian byte order. Read moreยงfn get_i16(&mut self) -> i16
fn get_i16(&mut self) -> i16
Gets a signed 16 bit integer from
self
in big-endian byte order. Read moreยงfn get_i16_le(&mut self) -> i16
fn get_i16_le(&mut self) -> i16
Gets a signed 16 bit integer from
self
in little-endian byte order. Read moreยงfn get_i16_ne(&mut self) -> i16
fn get_i16_ne(&mut self) -> i16
Gets a signed 16 bit integer from
self
in native-endian byte order. Read moreยงfn get_u32(&mut self) -> u32
fn get_u32(&mut self) -> u32
Gets an unsigned 32 bit integer from
self
in the big-endian byte order. Read moreยงfn get_u32_le(&mut self) -> u32
fn get_u32_le(&mut self) -> u32
Gets an unsigned 32 bit integer from
self
in the little-endian byte order. Read moreยงfn get_u32_ne(&mut self) -> u32
fn get_u32_ne(&mut self) -> u32
Gets an unsigned 32 bit integer from
self
in native-endian byte order. Read moreยงfn get_i32(&mut self) -> i32
fn get_i32(&mut self) -> i32
Gets a signed 32 bit integer from
self
in big-endian byte order. Read moreยงfn get_i32_le(&mut self) -> i32
fn get_i32_le(&mut self) -> i32
Gets a signed 32 bit integer from
self
in little-endian byte order. Read moreยงfn get_i32_ne(&mut self) -> i32
fn get_i32_ne(&mut self) -> i32
Gets a signed 32 bit integer from
self
in native-endian byte order. Read moreยงfn get_u64(&mut self) -> u64
fn get_u64(&mut self) -> u64
Gets an unsigned 64 bit integer from
self
in big-endian byte order. Read moreยงfn get_u64_le(&mut self) -> u64
fn get_u64_le(&mut self) -> u64
Gets an unsigned 64 bit integer from
self
in little-endian byte order. Read moreยงfn get_u64_ne(&mut self) -> u64
fn get_u64_ne(&mut self) -> u64
Gets an unsigned 64 bit integer from
self
in native-endian byte order. Read moreยงfn get_i64(&mut self) -> i64
fn get_i64(&mut self) -> i64
Gets a signed 64 bit integer from
self
in big-endian byte order. Read moreยงfn get_i64_le(&mut self) -> i64
fn get_i64_le(&mut self) -> i64
Gets a signed 64 bit integer from
self
in little-endian byte order. Read moreยงfn get_i64_ne(&mut self) -> i64
fn get_i64_ne(&mut self) -> i64
Gets a signed 64 bit integer from
self
in native-endian byte order. Read moreยงfn get_u128(&mut self) -> u128
fn get_u128(&mut self) -> u128
Gets an unsigned 128 bit integer from
self
in big-endian byte order. Read moreยงfn get_u128_le(&mut self) -> u128
fn get_u128_le(&mut self) -> u128
Gets an unsigned 128 bit integer from
self
in little-endian byte order. Read moreยงfn get_u128_ne(&mut self) -> u128
fn get_u128_ne(&mut self) -> u128
Gets an unsigned 128 bit integer from
self
in native-endian byte order. Read moreยงfn get_i128(&mut self) -> i128
fn get_i128(&mut self) -> i128
Gets a signed 128 bit integer from
self
in big-endian byte order. Read moreยงfn get_i128_le(&mut self) -> i128
fn get_i128_le(&mut self) -> i128
Gets a signed 128 bit integer from
self
in little-endian byte order. Read moreยงfn get_i128_ne(&mut self) -> i128
fn get_i128_ne(&mut self) -> i128
Gets a signed 128 bit integer from
self
in native-endian byte order. Read moreยงfn get_uint(&mut self, nbytes: usize) -> u64
fn get_uint(&mut self, nbytes: usize) -> u64
Gets an unsigned n-byte integer from
self
in big-endian byte order. Read moreยงfn get_uint_le(&mut self, nbytes: usize) -> u64
fn get_uint_le(&mut self, nbytes: usize) -> u64
Gets an unsigned n-byte integer from
self
in little-endian byte order. Read moreยงfn get_uint_ne(&mut self, nbytes: usize) -> u64
fn get_uint_ne(&mut self, nbytes: usize) -> u64
Gets an unsigned n-byte integer from
self
in native-endian byte order. Read moreยงfn get_int(&mut self, nbytes: usize) -> i64
fn get_int(&mut self, nbytes: usize) -> i64
Gets a signed n-byte integer from
self
in big-endian byte order. Read moreยงfn get_int_le(&mut self, nbytes: usize) -> i64
fn get_int_le(&mut self, nbytes: usize) -> i64
Gets a signed n-byte integer from
self
in little-endian byte order. Read moreยงfn get_int_ne(&mut self, nbytes: usize) -> i64
fn get_int_ne(&mut self, nbytes: usize) -> i64
Gets a signed n-byte integer from
self
in native-endian byte order. Read moreยงfn get_f32(&mut self) -> f32
fn get_f32(&mut self) -> f32
Gets an IEEE754 single-precision (4 bytes) floating point number from
self
in big-endian byte order. Read moreยงfn get_f32_le(&mut self) -> f32
fn get_f32_le(&mut self) -> f32
Gets an IEEE754 single-precision (4 bytes) floating point number from
self
in little-endian byte order. Read moreยงfn get_f32_ne(&mut self) -> f32
fn get_f32_ne(&mut self) -> f32
Gets an IEEE754 single-precision (4 bytes) floating point number from
self
in native-endian byte order. Read moreยงfn get_f64(&mut self) -> f64
fn get_f64(&mut self) -> f64
Gets an IEEE754 double-precision (8 bytes) floating point number from
self
in big-endian byte order. Read moreยงfn get_f64_le(&mut self) -> f64
fn get_f64_le(&mut self) -> f64
Gets an IEEE754 double-precision (8 bytes) floating point number from
self
in little-endian byte order. Read moreยงfn get_f64_ne(&mut self) -> f64
fn get_f64_ne(&mut self) -> f64
Gets an IEEE754 double-precision (8 bytes) floating point number from
self
in native-endian byte order. Read moreยงfn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), TryGetError>
fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), TryGetError>
ยงfn try_get_u8(&mut self) -> Result<u8, TryGetError>
fn try_get_u8(&mut self) -> Result<u8, TryGetError>
Gets an unsigned 8 bit integer from
self
. Read moreยงfn try_get_i8(&mut self) -> Result<i8, TryGetError>
fn try_get_i8(&mut self) -> Result<i8, TryGetError>
Gets a signed 8 bit integer from
self
. Read moreยงfn try_get_u16(&mut self) -> Result<u16, TryGetError>
fn try_get_u16(&mut self) -> Result<u16, TryGetError>
Gets an unsigned 16 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_u16_le(&mut self) -> Result<u16, TryGetError>
fn try_get_u16_le(&mut self) -> Result<u16, TryGetError>
Gets an unsigned 16 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_u16_ne(&mut self) -> Result<u16, TryGetError>
fn try_get_u16_ne(&mut self) -> Result<u16, TryGetError>
Gets an unsigned 16 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_i16(&mut self) -> Result<i16, TryGetError>
fn try_get_i16(&mut self) -> Result<i16, TryGetError>
Gets a signed 16 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_i16_le(&mut self) -> Result<i16, TryGetError>
fn try_get_i16_le(&mut self) -> Result<i16, TryGetError>
Gets an signed 16 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_i16_ne(&mut self) -> Result<i16, TryGetError>
fn try_get_i16_ne(&mut self) -> Result<i16, TryGetError>
Gets a signed 16 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_u32(&mut self) -> Result<u32, TryGetError>
fn try_get_u32(&mut self) -> Result<u32, TryGetError>
Gets an unsigned 32 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_u32_le(&mut self) -> Result<u32, TryGetError>
fn try_get_u32_le(&mut self) -> Result<u32, TryGetError>
Gets an unsigned 32 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_u32_ne(&mut self) -> Result<u32, TryGetError>
fn try_get_u32_ne(&mut self) -> Result<u32, TryGetError>
Gets an unsigned 32 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_i32(&mut self) -> Result<i32, TryGetError>
fn try_get_i32(&mut self) -> Result<i32, TryGetError>
Gets a signed 32 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_i32_le(&mut self) -> Result<i32, TryGetError>
fn try_get_i32_le(&mut self) -> Result<i32, TryGetError>
Gets a signed 32 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_i32_ne(&mut self) -> Result<i32, TryGetError>
fn try_get_i32_ne(&mut self) -> Result<i32, TryGetError>
Gets a signed 32 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_u64(&mut self) -> Result<u64, TryGetError>
fn try_get_u64(&mut self) -> Result<u64, TryGetError>
Gets an unsigned 64 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_u64_le(&mut self) -> Result<u64, TryGetError>
fn try_get_u64_le(&mut self) -> Result<u64, TryGetError>
Gets an unsigned 64 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_u64_ne(&mut self) -> Result<u64, TryGetError>
fn try_get_u64_ne(&mut self) -> Result<u64, TryGetError>
Gets an unsigned 64 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_i64(&mut self) -> Result<i64, TryGetError>
fn try_get_i64(&mut self) -> Result<i64, TryGetError>
Gets a signed 64 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_i64_le(&mut self) -> Result<i64, TryGetError>
fn try_get_i64_le(&mut self) -> Result<i64, TryGetError>
Gets a signed 64 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_i64_ne(&mut self) -> Result<i64, TryGetError>
fn try_get_i64_ne(&mut self) -> Result<i64, TryGetError>
Gets a signed 64 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_u128(&mut self) -> Result<u128, TryGetError>
fn try_get_u128(&mut self) -> Result<u128, TryGetError>
Gets an unsigned 128 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_u128_le(&mut self) -> Result<u128, TryGetError>
fn try_get_u128_le(&mut self) -> Result<u128, TryGetError>
Gets an unsigned 128 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_u128_ne(&mut self) -> Result<u128, TryGetError>
fn try_get_u128_ne(&mut self) -> Result<u128, TryGetError>
Gets an unsigned 128 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_i128(&mut self) -> Result<i128, TryGetError>
fn try_get_i128(&mut self) -> Result<i128, TryGetError>
Gets a signed 128 bit integer from
self
in big-endian byte order. Read moreยงfn try_get_i128_le(&mut self) -> Result<i128, TryGetError>
fn try_get_i128_le(&mut self) -> Result<i128, TryGetError>
Gets a signed 128 bit integer from
self
in little-endian byte order. Read moreยงfn try_get_i128_ne(&mut self) -> Result<i128, TryGetError>
fn try_get_i128_ne(&mut self) -> Result<i128, TryGetError>
Gets a signed 128 bit integer from
self
in native-endian byte order. Read moreยงfn try_get_uint(&mut self, nbytes: usize) -> Result<u64, TryGetError>
fn try_get_uint(&mut self, nbytes: usize) -> Result<u64, TryGetError>
Gets an unsigned n-byte integer from
self
in big-endian byte order. Read moreยงfn try_get_uint_le(&mut self, nbytes: usize) -> Result<u64, TryGetError>
fn try_get_uint_le(&mut self, nbytes: usize) -> Result<u64, TryGetError>
Gets an unsigned n-byte integer from
self
in little-endian byte order. Read moreยงfn try_get_uint_ne(&mut self, nbytes: usize) -> Result<u64, TryGetError>
fn try_get_uint_ne(&mut self, nbytes: usize) -> Result<u64, TryGetError>
Gets an unsigned n-byte integer from
self
in native-endian byte order. Read moreยงfn try_get_int(&mut self, nbytes: usize) -> Result<i64, TryGetError>
fn try_get_int(&mut self, nbytes: usize) -> Result<i64, TryGetError>
Gets a signed n-byte integer from
self
in big-endian byte order. Read moreยงfn try_get_int_le(&mut self, nbytes: usize) -> Result<i64, TryGetError>
fn try_get_int_le(&mut self, nbytes: usize) -> Result<i64, TryGetError>
Gets a signed n-byte integer from
self
in little-endian byte order. Read moreยงfn try_get_int_ne(&mut self, nbytes: usize) -> Result<i64, TryGetError>
fn try_get_int_ne(&mut self, nbytes: usize) -> Result<i64, TryGetError>
Gets a signed n-byte integer from
self
in native-endian byte order. Read moreยงfn try_get_f32(&mut self) -> Result<f32, TryGetError>
fn try_get_f32(&mut self) -> Result<f32, TryGetError>
Gets an IEEE754 single-precision (4 bytes) floating point number from
self
in big-endian byte order. Read moreยงfn try_get_f32_le(&mut self) -> Result<f32, TryGetError>
fn try_get_f32_le(&mut self) -> Result<f32, TryGetError>
Gets an IEEE754 single-precision (4 bytes) floating point number from
self
in little-endian byte order. Read moreยงfn try_get_f32_ne(&mut self) -> Result<f32, TryGetError>
fn try_get_f32_ne(&mut self) -> Result<f32, TryGetError>
Gets an IEEE754 single-precision (4 bytes) floating point number from
self
in native-endian byte order. Read moreยงfn try_get_f64(&mut self) -> Result<f64, TryGetError>
fn try_get_f64(&mut self) -> Result<f64, TryGetError>
Gets an IEEE754 double-precision (8 bytes) floating point number from
self
in big-endian byte order. Read moreยงfn try_get_f64_le(&mut self) -> Result<f64, TryGetError>
fn try_get_f64_le(&mut self) -> Result<f64, TryGetError>
Gets an IEEE754 double-precision (8 bytes) floating point number from
self
in little-endian byte order. Read moreยงfn try_get_f64_ne(&mut self) -> Result<f64, TryGetError>
fn try_get_f64_ne(&mut self) -> Result<f64, TryGetError>
Gets an IEEE754 double-precision (8 bytes) floating point number from
self
in native-endian byte order. Read moreAuto Trait Implementationsยง
impl<T> Freeze for Take<T>where
T: Freeze,
impl<T> RefUnwindSafe for Take<T>where
T: RefUnwindSafe,
impl<T> Send for Take<T>where
T: Send,
impl<T> Sync for Take<T>where
T: Sync,
impl<T> Unpin for Take<T>where
T: Unpin,
impl<T> UnwindSafe for Take<T>where
T: UnwindSafe,
Blanket Implementationsยง
Sourceยงimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Sourceยงfn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Convert the source color to the destination color using the specified
method.
Sourceยงfn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default.
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Sourceยงimpl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Sourceยงfn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Cast a collection of colors into a collection of arrays.
Sourceยงimpl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Sourceยงfn arrays_into(self) -> C
fn arrays_into(self) -> C
Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Sourceยงtype Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
The number type thatโs used in
parameters
when converting.Sourceยงfn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self
into C
, using the provided parameters.Sourceยงimpl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Sourceยงfn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Cast a collection of colors into a collection of color components.
ยงimpl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
ยงfn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
ยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
ยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.ยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.ยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
โs vtable from &Trait
โs.ยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.ยงimpl<T> DowncastSend for T
impl<T> DowncastSend for T
ยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
Sourceยงimpl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Sourceยงfn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
Performs a conversion from
angle
.Sourceยงimpl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Sourceยงfn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
Converts
other
into Self
, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงimpl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Sourceยงfn into_angle(self) -> U
fn into_angle(self) -> U
Performs a conversion into
T
.Sourceยงimpl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Sourceยงtype Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
The number type thatโs used in
parameters
when converting.Sourceยงfn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
Converts
self
into C
, using the provided parameters.Sourceยงimpl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Sourceยงfn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Sourceยงimpl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Sourceยงfn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Sourceยงfn into_stimulus(self) -> T
fn into_stimulus(self) -> T
Converts
self
into T
, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Pointable for T
impl<T> Pointable for T
ยงimpl<T> Pointee for T
impl<T> Pointee for T
ยงimpl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
ยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
ยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
ยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
ยงfn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.
Sourceยงimpl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Sourceยงtype Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
The error for when
try_into_colors
fails to cast.Sourceยงfn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Try to cast this collection of color components into a collection of
colors. Read more
Sourceยงimpl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Sourceยงfn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read moreSourceยงimpl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
impl<C, U> UintsFrom<C> for Uwhere
C: IntoUints<U>,
Sourceยงfn uints_from(colors: C) -> U
fn uints_from(colors: C) -> U
Cast a collection of colors into a collection of unsigned integers.
Sourceยงimpl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
impl<C, U> UintsInto<C> for Uwhere
C: FromUints<U>,
Sourceยงfn uints_into(self) -> C
fn uints_into(self) -> C
Cast this collection of unsigned integers into a collection of colors.