Skip to main content

Chain

Struct Chain 

pub struct Chain<T, U> {
    a: T,
    b: U,
}
Expand description

A Chain sequences two buffers.

Chain is an adapter that links two underlying buffers and provides a continuous view across both buffers. It is able to sequence either immutable buffers (Buf values) or mutable buffers (BufMut values).

This struct is generally created by calling Buf::chain. Please see that functionโ€™s documentation for more detail.

ยงExamples

use bytes::{Bytes, Buf};

let mut buf = (&b"hello "[..])
    .chain(&b"world"[..]);

let full: Bytes = buf.copy_to_bytes(11);
assert_eq!(full[..], b"hello world"[..]);

Fieldsยง

ยงa: Tยงb: U

Implementationsยง

ยง

impl<T, U> Chain<T, U>

pub fn first_ref(&self) -> &T

Gets a reference to the first underlying Buf.

ยงExamples
use bytes::Buf;

let buf = (&b"hello"[..])
    .chain(&b"world"[..]);

assert_eq!(buf.first_ref()[..], b"hello"[..]);

pub fn first_mut(&mut self) -> &mut T

Gets a mutable reference to the first underlying Buf.

ยงExamples
use bytes::Buf;

let mut buf = (&b"hello"[..])
    .chain(&b"world"[..]);

buf.first_mut().advance(1);

let full = buf.copy_to_bytes(9);
assert_eq!(full, b"elloworld"[..]);

pub fn last_ref(&self) -> &U

Gets a reference to the last underlying Buf.

ยงExamples
use bytes::Buf;

let buf = (&b"hello"[..])
    .chain(&b"world"[..]);

assert_eq!(buf.last_ref()[..], b"world"[..]);

pub fn last_mut(&mut self) -> &mut U

Gets a mutable reference to the last underlying Buf.

ยงExamples
use bytes::Buf;

let mut buf = (&b"hello "[..])
    .chain(&b"world"[..]);

buf.last_mut().advance(1);

let full = buf.copy_to_bytes(10);
assert_eq!(full, b"hello orld"[..]);

pub fn into_inner(self) -> (T, U)

Consumes this Chain, returning the underlying values.

ยงExamples
use bytes::Buf;

let chain = (&b"hello"[..])
    .chain(&b"world"[..]);

let (first, last) = chain.into_inner();
assert_eq!(first[..], b"hello"[..]);
assert_eq!(last[..], b"world"[..]);

Trait Implementationsยง

ยง

impl<T, U> Buf for Chain<T, U>
where T: Buf, U: Buf,

ยง

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] โ“˜

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 advance(&mut self, cnt: usize)

Advance the internal cursor of the Buf Read more
ยง

fn chunks_vectored<'a>(&'a self, dst: &mut [IoSlice<'a>]) -> usize

Available on crate feature std only.
Fills dst with potentially multiple slices starting at selfโ€™s current position. Read more
ยง

fn copy_to_bytes(&mut self, len: usize) -> Bytes

Consumes len bytes inside self and returns new instance of Bytes with this data. Read more
ยง

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])

Copies bytes from self into dst. Read more
ยง

fn get_u8(&mut self) -> u8

Gets an unsigned 8 bit integer from self. Read more
ยง

fn get_i8(&mut self) -> i8

Gets a signed 8 bit integer from self. Read more
ยง

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

Gets an unsigned 16 bit integer from self in little-endian byte order. Read more
ยง

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

Gets a signed 16 bit integer from self in big-endian byte order. Read more
ยง

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

Gets a signed 16 bit integer from self in native-endian byte order. Read more
ยง

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

Gets an unsigned 32 bit integer from self in the little-endian byte order. Read more
ยง

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

Gets a signed 32 bit integer from self in big-endian byte order. Read more
ยง

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

Gets a signed 32 bit integer from self in native-endian byte order. Read more
ยง

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

Gets an unsigned 64 bit integer from self in little-endian byte order. Read more
ยง

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

Gets a signed 64 bit integer from self in big-endian byte order. Read more
ยง

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

Gets a signed 64 bit integer from self in native-endian byte order. Read more
ยง

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

Gets an unsigned 128 bit integer from self in little-endian byte order. Read more
ยง

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

Gets a signed 128 bit integer from self in big-endian byte order. Read more
ยง

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

Gets a signed 128 bit integer from self in native-endian byte order. Read more
ยง

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

Gets an unsigned n-byte integer from self in little-endian byte order. Read more
ยง

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

Gets a signed n-byte integer from self in big-endian byte order. Read more
ยง

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

Gets a signed n-byte integer from self in native-endian byte order. Read more
ยง

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

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

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

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

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

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>

Copies bytes from self into dst. Read more
ยง

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>

Gets a signed 8 bit integer from self. Read more
ยง

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>

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>

Gets an unsigned 16 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

Gets a signed 16 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

Gets an unsigned 32 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

Gets a signed 32 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

Gets an unsigned 64 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

Gets a signed 64 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

Gets an unsigned 128 bit integer from self in native-endian byte order. Read more
ยง

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>

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>

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>

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>

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>

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>

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>

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>

Gets a signed n-byte integer from self in native-endian byte order. Read more
ยง

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>

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>

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>

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>

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>

Gets an IEEE754 double-precision (8 bytes) floating point number from self in native-endian byte order. Read more
ยง

fn take(self, limit: usize) -> Take<Self>
where Self: Sized,

Creates an adaptor which will read at most limit bytes from self. Read more
ยง

fn chain<U>(self, next: U) -> Chain<Self, U>
where U: Buf, Self: Sized,

Creates an adaptor which will chain this buffer with another. Read more
ยง

fn reader(self) -> Reader<Self> โ“˜
where Self: Sized,

Available on crate feature std only.
Creates an adaptor which implements the Read trait for self. Read more
ยง

impl<T, U> BufMut for Chain<T, U>
where T: BufMut, U: BufMut,

ยง

fn remaining_mut(&self) -> usize

Returns the number of bytes that can be written from the current position until the end of the buffer is reached. Read more
ยง

fn chunk_mut(&mut self) -> &mut UninitSlice

Returns a mutable slice starting at the current BufMut position and of length between 0 and BufMut::remaining_mut(). Note that this can be shorter than the whole remainder of the buffer (this allows non-continuous implementation). Read more
ยง

unsafe fn advance_mut(&mut self, cnt: usize)

Advance the internal cursor of the BufMut Read more
ยง

fn has_remaining_mut(&self) -> bool

Returns true if there is space in self for more bytes. Read more
ยง

fn put<T>(&mut self, src: T)
where T: Buf, Self: Sized,

Transfer bytes into self from src and advance the cursor by the number of bytes written. Read more
ยง

fn put_slice(&mut self, src: &[u8])

Transfer bytes into self from src and advance the cursor by the number of bytes written. Read more
ยง

fn put_bytes(&mut self, val: u8, cnt: usize)

Put cnt bytes val into self. Read more
ยง

fn put_u8(&mut self, n: u8)

Writes an unsigned 8 bit integer to self. Read more
ยง

fn put_i8(&mut self, n: i8)

Writes a signed 8 bit integer to self. Read more
ยง

fn put_u16(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in big-endian byte order. Read more
ยง

fn put_u16_le(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in little-endian byte order. Read more
ยง

fn put_u16_ne(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in native-endian byte order. Read more
ยง

fn put_i16(&mut self, n: i16)

Writes a signed 16 bit integer to self in big-endian byte order. Read more
ยง

fn put_i16_le(&mut self, n: i16)

Writes a signed 16 bit integer to self in little-endian byte order. Read more
ยง

fn put_i16_ne(&mut self, n: i16)

Writes a signed 16 bit integer to self in native-endian byte order. Read more
ยง

fn put_u32(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in big-endian byte order. Read more
ยง

fn put_u32_le(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in little-endian byte order. Read more
ยง

fn put_u32_ne(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in native-endian byte order. Read more
ยง

fn put_i32(&mut self, n: i32)

Writes a signed 32 bit integer to self in big-endian byte order. Read more
ยง

fn put_i32_le(&mut self, n: i32)

Writes a signed 32 bit integer to self in little-endian byte order. Read more
ยง

fn put_i32_ne(&mut self, n: i32)

Writes a signed 32 bit integer to self in native-endian byte order. Read more
ยง

fn put_u64(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in the big-endian byte order. Read more
ยง

fn put_u64_le(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in little-endian byte order. Read more
ยง

fn put_u64_ne(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in native-endian byte order. Read more
ยง

fn put_i64(&mut self, n: i64)

Writes a signed 64 bit integer to self in the big-endian byte order. Read more
ยง

fn put_i64_le(&mut self, n: i64)

Writes a signed 64 bit integer to self in little-endian byte order. Read more
ยง

fn put_i64_ne(&mut self, n: i64)

Writes a signed 64 bit integer to self in native-endian byte order. Read more
ยง

fn put_u128(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in the big-endian byte order. Read more
ยง

fn put_u128_le(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in little-endian byte order. Read more
ยง

fn put_u128_ne(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in native-endian byte order. Read more
ยง

fn put_i128(&mut self, n: i128)

Writes a signed 128 bit integer to self in the big-endian byte order. Read more
ยง

fn put_i128_le(&mut self, n: i128)

Writes a signed 128 bit integer to self in little-endian byte order. Read more
ยง

fn put_i128_ne(&mut self, n: i128)

Writes a signed 128 bit integer to self in native-endian byte order. Read more
ยง

fn put_uint(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in big-endian byte order. Read more
ยง

fn put_uint_le(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in the little-endian byte order. Read more
ยง

fn put_uint_ne(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in the native-endian byte order. Read more
ยง

fn put_int(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in big-endian byte order. Read more
ยง

fn put_int_le(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in little-endian byte order. Read more
ยง

fn put_int_ne(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in native-endian byte order. Read more
ยง

fn put_f32(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to self in big-endian byte order. Read more
ยง

fn put_f32_le(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to self in little-endian byte order. Read more
ยง

fn put_f32_ne(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to self in native-endian byte order. Read more
ยง

fn put_f64(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to self in big-endian byte order. Read more
ยง

fn put_f64_le(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to self in little-endian byte order. Read more
ยง

fn put_f64_ne(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to self in native-endian byte order. Read more
ยง

fn limit(self, limit: usize) -> Limit<Self>
where Self: Sized,

Creates an adaptor which can write at most limit bytes to self. Read more
ยง

fn writer(self) -> Writer<Self> โ“˜
where Self: Sized,

Available on crate feature std only.
Creates an adaptor which implements the Write trait for self. Read more
ยง

fn chain_mut<U>(self, next: U) -> Chain<Self, U>
where U: BufMut, Self: Sized,

Creates an adapter which will chain this buffer with another. Read more
ยง

impl<T, U> Debug for Chain<T, U>
where T: Debug, U: Debug,

ยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
ยง

impl<T, U> IntoIterator for Chain<T, U>
where T: Buf, U: Buf,

ยง

type Item = u8

The type of the elements being iterated over.
ยง

type IntoIter = IntoIter<Chain<T, U>>

Which kind of iterator are we turning this into?
ยง

fn into_iter(self) -> <Chain<T, U> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
ยง

impl<T, U> IntoResponse for Chain<T, U>
where T: Buf + Unpin + Send + 'static, U: Buf + Unpin + Send + 'static,

ยง

fn into_response(self) -> Response<Body>

Create a response.

Auto Trait Implementationsยง

ยง

impl<T, U> Freeze for Chain<T, U>
where T: Freeze, U: Freeze,

ยง

impl<T, U> RefUnwindSafe for Chain<T, U>

ยง

impl<T, U> Send for Chain<T, U>
where T: Send, U: Send,

ยง

impl<T, U> Sync for Chain<T, U>
where T: Sync, U: Sync,

ยง

impl<T, U> Unpin for Chain<T, U>
where T: Unpin, U: Unpin,

ยง

impl<T, U> UnsafeUnpin for Chain<T, U>
where T: UnsafeUnpin, U: UnsafeUnpin,

ยง

impl<T, U> UnwindSafe for Chain<T, U>
where T: UnwindSafe, U: UnwindSafe,

Blanket Implementationsยง

Sourceยง

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where 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) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Sourceยง

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Sourceยง

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Sourceยง

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Sourceยง

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Sourceยง

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

Converts self into C, using the provided parameters.
ยง

impl<It, V> CollectView for It
where It: IntoIterator<Item = V>, V: IntoView,

ยง

type View = V

The inner view type.
ยง

fn collect_view(self) -> Vec<<It as CollectView>::View>

Collects the iterator into a list of views.
Sourceยง

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Sourceยง

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
ยง

impl<T> Downcast for T
where T: 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>

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)

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)

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
where T: Any + Send,

ยง

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

ยง

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> โ“˜

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> FromAngle<T> for T

Sourceยง

fn from_angle(angle: T) -> T

Performs a conversion from angle.
ยง

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
ยง

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
ยง

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Sourceยง

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Sourceยง

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T, U> IntoAngle<U> for T
where U: FromAngle<T>,

Sourceยง

fn into_angle(self) -> U

Performs a conversion into T.
Sourceยง

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Sourceยง

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

Converts self into C, using the provided parameters.
Sourceยง

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Sourceยง

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 T
where U: FromColorUnclamped<T>,

Sourceยง

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

Sourceยง

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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Sourceยง

impl<ET, Err, A> IntoErr<ET, Err> for A
where ET: EngineTypes, Err: From<A>,

Sourceยง

fn into_err( self, _aux: &EngineAux<ET>, _state: &<ET as EngineTypes>::State, ) -> Err

ยง

impl<T, I> IntoReactiveValue<T, __IntoReactiveValueMarkerBaseCase> for I
where I: Into<T>,

ยง

fn into_reactive_value(self) -> T

Converts self into a T.
ยง

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
ยง

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
ยง

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Sourceยง

impl<T> IntoStimulus<T> for T

Sourceยง

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
ยง

impl<D> OwoColorize for D

ยง

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
ยง

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
ยง

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
ยง

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
ยง

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
ยง

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
ยง

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
ยง

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
ยง

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
ยง

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
ยง

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
ยง

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
ยง

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
ยง

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
ยง

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
ยง

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
ยง

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
ยง

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
ยง

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
ยง

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
ยง

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
ยง

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
ยง

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
ยง

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
ยง

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
ยง

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
ยง

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
ยง

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
ยง

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
ยง

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
ยง

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
ยง

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
ยง

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
ยง

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
ยง

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
ยง

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
ยง

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
ยง

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
ยง

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
ยง

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
ยง

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
ยง

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
ยง

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
ยง

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
ยง

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
ยง

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
ยง

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
ยง

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [OwoColorize::fg] or a color-specific method, such as [OwoColorize::green], Read more
ยง

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [OwoColorize::bg] or a color-specific method, such as [OwoColorize::on_yellow], Read more
ยง

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
ยง

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
ยง

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
ยง

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
ยง

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
ยง

fn if_supports_color<'a, Out, ApplyFn>( &'a self, stream: impl Into<Stream>, apply: ApplyFn, ) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>
where ApplyFn: Fn(&'a Self) -> Out,

Available on crate feature supports-colors only.
Apply a given transformation function to all formatters if the given stream supports at least basic ANSI colors, allowing you to conditionally apply given styles/colors. Read more
ยง

impl<T> Pointable for T

ยง

const ALIGN: usize

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
ยง

impl<T> PolicyExt for T
where T: ?Sized,

ยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
ยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
ยง

impl<T> SerializableKey for T

ยง

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
ยง

impl<T> StorageAccess<T> for T

ยง

fn as_borrowed(&self) -> &T

Borrows the value.
ยง

fn into_taken(self) -> T

Takes the value.
Sourceยง

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Sourceยง

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>

Try to cast this collection of color components into a collection of colors. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Sourceยง

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 more
Sourceยง

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Sourceยง

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Sourceยง

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Sourceยง

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
Sourceยง

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Sourceยง

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Sourceยง

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
ยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

impl<T> Fruit for T
where T: Send + Downcast,