Struct geng::prelude::vec2

#[repr(C)]
pub struct vec2<T>(pub T, pub T);
Expand description

2 dimensional vector.

Tuple Fields§

§0: T§1: T

Implementations§

§

impl<T> vec2<T>

pub fn extend(self, z: T) -> vec3<T>

Extend into a 3-d vector.

§Examples
assert_eq!(vec2(1, 2).extend(3), vec3(1, 2, 3));

pub fn map<U, F>(self, f: F) -> vec2<U>
where F: Fn(T) -> U,

Map every component (coordinate)

pub fn zip<U>(self, v: vec2<U>) -> vec2<(T, U)>

Zip two vectors together

§

impl<T> vec2<T>
where T: Clone,

pub fn splat(value: T) -> vec2<T>

Construct a vector with all components set to specified value

§

impl<T> vec2<T>
where T: UNum,

pub const ZERO: vec2<T> = _

A zero 2-d vector

pub const UNIT_X: vec2<T> = _

A unit X

pub const UNIT_Y: vec2<T> = _

A unit Y

§

impl<T> vec2<T>
where T: Num,

pub fn dot(a: vec2<T>, b: vec2<T>) -> T

Calculate dot product of two vectors.

§Examples
assert_eq!(vec2::dot(vec2(1, 2), vec2(3, 4)), 11);

pub fn skew(a: vec2<T>, b: vec2<T>) -> T

Calculate skew product of two vectors.

§Examples
assert_eq!(vec2::skew(vec2(1, 2), vec2(3, 4)), -2);
§

impl<T> vec2<T>
where T: Neg<Output = T>,

pub fn rotate_90(self) -> vec2<T>

Rotate a vector by 90 degrees counter clockwise.

§Examples
let v = vec2(3.0, 4.0);
assert_eq!(v.rotate_90(), vec2(-4.0, 3.0));
§

impl<T> vec2<T>
where T: Float,

pub fn normalize(self) -> vec2<T>

Normalize a vector.

§Examples
let v: vec2<f64> = vec2(1.0, 2.0);
assert!((v.normalize().len() - 1.0).abs() < 1e-5);

pub fn normalize_or_zero(self) -> vec2<T>

Normalizes a vector unless its length its approximately 0. Can be used to avoid division by 0.

§Examples
let v = vec2(1.0, 2.0);
assert_eq!(v.normalize_or_zero(), v.normalize());
let v = vec2(1e-10, 1e-10);
assert_eq!(v.normalize_or_zero(), vec2::ZERO);

pub fn len(self) -> T

Calculate length of a vector.

§Examples
let v = vec2(3.0, 4.0);
assert_eq!(v.len(), 5.0);

pub fn len_sqr(self) -> T

Calculate squared length of this vector

pub fn rotate(self, angle: Angle<T>) -> vec2<T>

Rotate a vector by a given angle.

§Examples
let v = vec2(1.0, 2.0);
assert!((v.rotate(Angle::from_radians(std::f32::consts::FRAC_PI_2)) - vec2(-2.0, 1.0)).len() < 1e-5);

pub fn clamp_len(self, len_range: impl FixedRangeBounds<T>) -> vec2<T>

Clamp vector’s length. Note that the range must be inclusive.

§Examples
let v = vec2(1.0, 2.0);
assert_eq!(v.clamp_len(..=1.0), v.normalize());

pub fn clamp_coordinates( self, x_range: impl FixedRangeBounds<T>, y_range: impl FixedRangeBounds<T> ) -> vec2<T>

Clamp vector in range. Note the range must be inclusive.

§Examples
let v = vec2(1.0, 2.0);
assert_eq!(v.clamp_coordinates(.., 0.0..=1.0), vec2(1.0, 1.0));

pub fn clamp_aabb(self, aabb: Aabb2<T>) -> vec2<T>

Clamp vector by aabb corners.

§Examples
let v = vec2(0.5, 2.0);
let min = vec2(0.0, 0.0);
let max = vec2(1.0, 1.0);
let aabb = Aabb2::from_corners(min, max);
assert_eq!(v.clamp_aabb(aabb), vec2(0.5, 1.0));

pub fn arg(self) -> Angle<T>

Get an angle between the positive direction of the x-axis.

§Examples
let v = vec2(0.0, 1.0);
assert_eq!(v.arg().as_radians(), std::f32::consts::FRAC_PI_2);

pub fn transform(self, transform: mat3<T>) -> vec2<T>

Apply transformation matrix

pub fn aspect(self) -> T

Calculate aspect ratio (x / y)

Methods from Deref<Target = [T; 2]>§

1.57.0 · source

pub fn as_slice(&self) -> &[T]

Returns a slice containing the entire array. Equivalent to &s[..].

1.57.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Returns a mutable slice containing the entire array. Equivalent to &mut s[..].

source

pub fn each_ref(&self) -> [&T; N]

🔬This is a nightly-only experimental API. (array_methods)

Borrows each element and returns an array of references with the same size as self.

§Example
#![feature(array_methods)]

let floats = [3.1, 2.7, -1.0];
let float_refs: [&f64; 3] = floats.each_ref();
assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);

This method is particularly useful if combined with other methods, like map. This way, you can avoid moving the original array if its elements are not Copy.

#![feature(array_methods)]

let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
let is_ascii = strings.each_ref().map(|s| s.is_ascii());
assert_eq!(is_ascii, [true, false, true]);

// We can still access the original array: it has not been moved.
assert_eq!(strings.len(), 3);
source

pub fn each_mut(&mut self) -> [&mut T; N]

🔬This is a nightly-only experimental API. (array_methods)

Borrows each element mutably and returns an array of mutable references with the same size as self.

§Example
#![feature(array_methods)]

let mut floats = [3.1, 2.7, -1.0];
let float_refs: [&mut f64; 3] = floats.each_mut();
*float_refs[0] = 0.0;
assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
assert_eq!(floats, [0.0, 2.7, -1.0]);
source

pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one array reference into two at an index.

The first will contain all indices from [0, M) (excluding the index M itself) and the second will contain all indices from [M, N) (excluding the index N itself).

§Panics

Panics if M > N.

§Examples
#![feature(split_array)]

let v = [1, 2, 3, 4, 5, 6];

{
   let (left, right) = v.split_array_ref::<0>();
   assert_eq!(left, &[]);
   assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
}

{
    let (left, right) = v.split_array_ref::<2>();
    assert_eq!(left, &[1, 2]);
    assert_eq!(right, &[3, 4, 5, 6]);
}

{
    let (left, right) = v.split_array_ref::<6>();
    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
    assert_eq!(right, &[]);
}
source

pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable array reference into two at an index.

The first will contain all indices from [0, M) (excluding the index M itself) and the second will contain all indices from [M, N) (excluding the index N itself).

§Panics

Panics if M > N.

§Examples
#![feature(split_array)]

let mut v = [1, 0, 3, 0, 5, 6];
let (left, right) = v.split_array_mut::<2>();
assert_eq!(left, &mut [1, 0][..]);
assert_eq!(right, &mut [3, 0, 5, 6]);
left[1] = 2;
right[1] = 4;
assert_eq!(v, [1, 2, 3, 4, 5, 6]);
source

pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])

🔬This is a nightly-only experimental API. (split_array)

Divides one array reference into two at an index from the end.

The first will contain all indices from [0, N - M) (excluding the index N - M itself) and the second will contain all indices from [N - M, N) (excluding the index N itself).

§Panics

Panics if M > N.

§Examples
#![feature(split_array)]

let v = [1, 2, 3, 4, 5, 6];

{
   let (left, right) = v.rsplit_array_ref::<0>();
   assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
   assert_eq!(right, &[]);
}

{
    let (left, right) = v.rsplit_array_ref::<2>();
    assert_eq!(left, &[1, 2, 3, 4]);
    assert_eq!(right, &[5, 6]);
}

{
    let (left, right) = v.rsplit_array_ref::<6>();
    assert_eq!(left, &[]);
    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
}
source

pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable array reference into two at an index from the end.

The first will contain all indices from [0, N - M) (excluding the index N - M itself) and the second will contain all indices from [N - M, N) (excluding the index N itself).

§Panics

Panics if M > N.

§Examples
#![feature(split_array)]

let mut v = [1, 0, 3, 0, 5, 6];
let (left, right) = v.rsplit_array_mut::<4>();
assert_eq!(left, &mut [1, 0]);
assert_eq!(right, &mut [3, 0, 5, 6][..]);
left[1] = 2;
right[1] = 4;
assert_eq!(v, [1, 2, 3, 4, 5, 6]);
source

pub fn as_ascii(&self) -> Option<&[AsciiChar; N]>

🔬This is a nightly-only experimental API. (ascii_char)

Converts this array of bytes into a array of ASCII characters, or returns None if any of the characters is non-ASCII.

§Examples
#![feature(ascii_char)]
#![feature(const_option)]

const HEX_DIGITS: [std::ascii::Char; 16] =
    *b"0123456789abcdef".as_ascii().unwrap();

assert_eq!(HEX_DIGITS[1].as_str(), "1");
assert_eq!(HEX_DIGITS[10].as_str(), "a");
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this array of bytes into a array of ASCII characters, without checking whether they’re valid.

§Safety

Every byte in the array must be in 0..=127, or else this is UB.

Trait Implementations§

§

impl<T> Add for vec2<T>
where T: Add<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the + operator.
§

fn add(self, rhs: vec2<T>) -> vec2<T>

Performs the + operation. Read more
§

impl<T> AddAssign for vec2<T>
where T: AddAssign,

§

fn add_assign(&mut self, rhs: vec2<T>)

Performs the += operation. Read more
§

impl<T> Clone for vec2<T>
where T: Clone,

§

fn clone(&self) -> vec2<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for vec2<T>
where T: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<T> Deref for vec2<T>

§

type Target = XY<T>

The resulting type after dereferencing.
§

fn deref(&self) -> &XY<T>

Dereferences the value.
§

impl<T> DerefMut for vec2<T>

§

fn deref_mut(&mut self) -> &mut XY<T>

Mutably dereferences the value.
§

impl<'de, T> Deserialize<'de> for vec2<T>
where T: Deserialize<'de>,

§

fn deserialize<__D>( __deserializer: __D ) -> Result<vec2<T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<T> Display for vec2<T>
where T: Display,

§

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

Formats the value using the given formatter. Read more
§

impl<T> Div<T> for vec2<T>
where T: Copy + Div<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the / operator.
§

fn div(self, rhs: T) -> vec2<T>

Performs the / operation. Read more
§

impl<T> Div for vec2<T>
where T: Div<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the / operator.
§

fn div(self, rhs: vec2<T>) -> vec2<T>

Performs the / operation. Read more
§

impl<T> DivAssign<T> for vec2<T>
where T: Copy + DivAssign,

§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
§

impl<T> DivAssign for vec2<T>
where T: DivAssign,

§

fn div_assign(&mut self, rhs: vec2<T>)

Performs the /= operation. Read more
§

impl<T> From<[T; 2]> for vec2<T>

§

fn from(v: [T; 2]) -> vec2<T>

Converts to this type from the input type.
source§

impl From<vec2<f32>> for ColoredVertex

source§

fn from(v: vec2<f32>) -> ColoredVertex

Converts to this type from the input type.
§

impl<T> Hash for vec2<T>
where T: Hash,

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> Mul<T> for vec2<T>
where T: Copy + Mul<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the * operator.
§

fn mul(self, rhs: T) -> vec2<T>

Performs the * operation. Read more
§

impl Mul<vec2<f32>> for f32

§

type Output = vec2<f32>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<f32>) -> vec2<f32>

Performs the * operation. Read more
§

impl Mul<vec2<f64>> for f64

§

type Output = vec2<f64>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<f64>) -> vec2<f64>

Performs the * operation. Read more
§

impl Mul<vec2<i16>> for i16

§

type Output = vec2<i16>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<i16>) -> vec2<i16>

Performs the * operation. Read more
§

impl Mul<vec2<i32>> for i32

§

type Output = vec2<i32>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<i32>) -> vec2<i32>

Performs the * operation. Read more
§

impl Mul<vec2<i64>> for i64

§

type Output = vec2<i64>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<i64>) -> vec2<i64>

Performs the * operation. Read more
§

impl Mul<vec2<i8>> for i8

§

type Output = vec2<i8>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<i8>) -> vec2<i8>

Performs the * operation. Read more
§

impl Mul<vec2<isize>> for isize

§

type Output = vec2<isize>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<isize>) -> vec2<isize>

Performs the * operation. Read more
§

impl Mul<vec2<u16>> for u16

§

type Output = vec2<u16>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<u16>) -> vec2<u16>

Performs the * operation. Read more
§

impl Mul<vec2<u32>> for u32

§

type Output = vec2<u32>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<u32>) -> vec2<u32>

Performs the * operation. Read more
§

impl Mul<vec2<u64>> for u64

§

type Output = vec2<u64>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<u64>) -> vec2<u64>

Performs the * operation. Read more
§

impl Mul<vec2<u8>> for u8

§

type Output = vec2<u8>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<u8>) -> vec2<u8>

Performs the * operation. Read more
§

impl Mul<vec2<usize>> for usize

§

type Output = vec2<usize>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<usize>) -> vec2<usize>

Performs the * operation. Read more
§

impl<T> Mul for vec2<T>
where T: Mul<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the * operator.
§

fn mul(self, rhs: vec2<T>) -> vec2<T>

Performs the * operation. Read more
§

impl<T> MulAssign<T> for vec2<T>
where T: Copy + MulAssign,

§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
§

impl<T> MulAssign for vec2<T>
where T: MulAssign,

§

fn mul_assign(&mut self, rhs: vec2<T>)

Performs the *= operation. Read more
§

impl<T> Neg for vec2<T>
where T: Neg<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the - operator.
§

fn neg(self) -> vec2<T>

Performs the unary - operation. Read more
§

impl<T> PartialEq for vec2<T>
where T: PartialEq,

§

fn eq(&self, other: &vec2<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> Serialize for vec2<T>
where T: Serialize,

§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<T> Sub for vec2<T>
where T: Sub<Output = T>,

§

type Output = vec2<T>

The resulting type after applying the - operator.
§

fn sub(self, rhs: vec2<T>) -> vec2<T>

Performs the - operation. Read more
§

impl<T> SubAssign for vec2<T>
where T: SubAssign,

§

fn sub_assign(&mut self, rhs: vec2<T>)

Performs the -= operation. Read more
source§

impl<U> Uniform for vec2<U>
where [U; 2]: Uniform,

source§

fn apply(&self, gl: &Context, info: &UniformInfo)

source§

impl VertexAttribute for vec2<f32>

§

impl<T> Copy for vec2<T>
where T: Copy,

§

impl<T> Eq for vec2<T>
where T: Eq,

§

impl<T> StructuralEq for vec2<T>

§

impl<T> StructuralPartialEq for vec2<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for vec2<T>
where T: RefUnwindSafe,

§

impl<T> Send for vec2<T>
where T: Send,

§

impl<T> Sync for vec2<T>
where T: Sync,

§

impl<T> Unpin for vec2<T>
where T: Unpin,

§

impl<T> UnwindSafe for vec2<T>
where T: UnwindSafe,

Blanket Implementations§

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> 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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
source§

impl<T> Configurable for T
where T: ToString + Clone,

§

type Config = ShowValue<T>

source§

fn config(theme: &Rc<Theme>, value: T) -> ShowValue<T>

§

impl<T> Diff for T
where T: Debug + Serialize + DeserializeOwned + Sync + Send + Copy + PartialEq + 'static + Unpin,

§

type Delta = T

Object representing the difference between two states of Self
§

fn diff(&self, to: &T) -> T

Calculate the difference between two states
§

fn update(&mut self, new_value: &T)

Update the state using the delta Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

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

§

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

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.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.
§

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
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

source§

impl<T> Message for T
where T: Debug + Serialize + for<'de> Deserialize<'de> + Send + 'static + Unpin,