kiddo::fixed::kdtree

Struct KdTree

Source
pub struct KdTree<A: Copy + Default, T: Copy + Default, const K: usize, const B: usize, IDX> { /* private fields */ }
Expand description

Fixed point k-d tree

For use when the co-ordinates of the points being stored in the tree are fixed point or integers. u8, u16, u32, and u64 based fixed-point / integers are supported via the Fixed crate, eg FixedU16<U14> for a 16-bit fixed point number with 14 bits after the decimal point.

Implementations§

Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn add(&mut self, query: &[A; K], item: T)

Adds an item to the tree.

The first argument specifies co-ordinates of the point where the item is located. The second argument is an integer identifier / index for the item being stored.

§Examples
use fixed::FixedU16;
use fixed::types::extra::U0;
use kiddo::fixed::kdtree::KdTree;

type Fxd = FixedU16<U0>;

let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::with_capacity(1_000_000);

tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);

assert_eq!(tree.size(), 2);
Source

pub fn remove(&mut self, query: &[A; K], item: T) -> usize

Removes an item from the tree.

The first argument specifies co-ordinates of the point where the item is located. The second argument is the integer identifier / index for the stored item.

§Examples
use fixed::FixedU16;
use fixed::types::extra::U0;
use kiddo::fixed::kdtree::KdTree;

type Fxd = FixedU16<U0>;

let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::with_capacity(1_000_000);

tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 101);
assert_eq!(tree.size(), 2);

tree.remove(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
assert_eq!(tree.size(), 1);

tree.remove(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 101);
assert_eq!(tree.size(), 0);
Source§

impl<A, T, const K: usize, const B: usize, IDX> KdTree<A, T, K, B, IDX>
where A: Axis, T: Content, IDX: Index<T = IDX>, usize: Cast<IDX>,

Source

pub fn new() -> Self

Creates a new fixed-point/int KdTree.

Capacity is set by default to 10x the bucket size (32 in this case).

§Examples
use fixed::FixedU16;
use fixed::types::extra::U14;
use kiddo::fixed::kdtree::KdTree;

let mut tree: KdTree<FixedU16<U14>, u32, 3, 32, u32> = KdTree::new();

assert_eq!(tree.size(), 0);
Source

pub fn with_capacity(capacity: usize) -> Self

Creates a new fixed-point/integer KdTree and reserves capacity for a specific number of items.

§Examples
use fixed::FixedU16;
use fixed::types::extra::U14;
use kiddo::fixed::kdtree::KdTree;

let mut tree: KdTree<FixedU16<U14>, u32, 3, 32, u32> = KdTree::with_capacity(1_000_000);

assert_eq!(tree.size(), 0);
Source

pub fn size(&self) -> T

Returns the current number of elements stored in the tree

§Examples
use fixed::FixedU16;
use fixed::types::extra::U0;
use kiddo::fixed::kdtree::KdTree;

type Fxd = FixedU16<U0>;

let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::with_capacity(1_000_000);

tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);

assert_eq!(tree.size(), 2);
Source

pub fn iter(&self) -> impl Iterator<Item = (T, [A; K])> + '_

Iterate over all (index, point) tuples in arbitrary order.

use fixed::FixedU16;
use fixed::types::extra::U0;
use kiddo::fixed::kdtree::KdTree;

type Fxd = FixedU16<U0>;

let point = [Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(3)];
let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

tree.add(&point, 10);

let mut pairs: Vec<_> = tree.iter().collect();
assert_eq!(pairs.pop().unwrap(), (10, point));
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn best_n_within<D>( &self, query: &[A; K], dist: A, max_qty: usize, ) -> impl Iterator<Item = BestNeighbour<A, T>>
where D: DistanceMetric<A, K>,

Queries the tree to find the best n elements within dist of point, using the specified distance metric.

Returns an iterator. Results are returned in arbitrary order. ‘Best’ is determined by performing a comparison of the elements using < (ie, std::cmp::Ordering::is_lt).

§Examples
    use fixed::FixedU16;
    use fixed::types::extra::U0;
    use kiddo::best_neighbour::BestNeighbour;
    use kiddo::fixed::kdtree::KdTree;
    use kiddo::fixed::distance::SquaredEuclidean;

    type Fxd = FixedU16<U0>;

    let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

    tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
    tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 1);
    tree.add(&[Fxd::from_num(20), Fxd::from_num(30), Fxd::from_num(60)], 102);

    let mut best_n_within_iter = tree.best_n_within::<SquaredEuclidean>(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], Fxd::from_num(10), 1);
    let first = best_n_within_iter.next().unwrap();

    assert_eq!(first, BestNeighbour { distance: Fxd::from_num(3), item: 1 });
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn nearest_n<D>( &self, query: &[A; K], qty: usize, ) -> Vec<NearestNeighbour<A, T>>
where D: DistanceMetric<A, K>,

Finds the nearest qty elements to query, using the specified distance metric function.

§Examples
    use fixed::FixedU16;
    use fixed::types::extra::U0;
    use kiddo::fixed::kdtree::KdTree;
    use kiddo::fixed::distance::SquaredEuclidean;

    type Fxd = FixedU16<U0>;

    let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

    tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
    tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);

    let nearest: Vec<_> = tree.nearest_n::<SquaredEuclidean>(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 1);

    assert_eq!(nearest.len(), 1);
    assert_eq!(nearest[0].distance, Fxd::from_num(0));
    assert_eq!(nearest[0].item, 100);
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn nearest_one<D>(&self, query: &[A; K]) -> NearestNeighbour<A, T>
where D: DistanceMetric<A, K>,

Queries the tree to find the nearest element to query, using the specified distance metric function.

Faster than querying for nearest_n(point, 1, …) due to not needing to allocate memory or maintain sorted results.

§Examples
    use fixed::FixedU16;
    use fixed::types::extra::U0;
    use kiddo::fixed::kdtree::KdTree;
    use kiddo::fixed::distance::SquaredEuclidean;

    type Fxd = FixedU16<U0>;

    let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

    tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
    tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);

    let nearest = tree.nearest_one::<SquaredEuclidean>(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)]);

    assert_eq!(nearest.distance, Fxd::from_num(0));
    assert_eq!(nearest.item, 100);
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn within<D>(&self, query: &[A; K], dist: A) -> Vec<NearestNeighbour<A, T>>
where D: DistanceMetric<A, K>,

Finds all elements within dist of query, using the specified distance metric function.

Results are returned sorted nearest-first

§Examples
    use fixed::FixedU16;
    use fixed::types::extra::U0;
    use kiddo::fixed::kdtree::KdTree;
    use kiddo::fixed::distance::SquaredEuclidean;

    type Fxd = FixedU16<U0>;

    let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

    tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
    tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);
    tree.add(&[Fxd::from_num(20), Fxd::from_num(30), Fxd::from_num(60)], 102);

    let within = tree.within::<SquaredEuclidean>(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], Fxd::from_num(10));

    assert_eq!(within.len(), 2);
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn within_unsorted<D>( &self, query: &[A; K], dist: A, ) -> Vec<NearestNeighbour<A, T>>
where D: DistanceMetric<A, K>,

Finds all elements within dist of query, using the specified distance metric function.

Results are returned in arbitrary order. Faster than within.

§Examples
    use fixed::FixedU16;
    use fixed::types::extra::U0;
    use kiddo::fixed::kdtree::KdTree;
    use kiddo::fixed::distance::SquaredEuclidean;

    type Fxd = FixedU16<U0>;


    let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

    tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
    tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);
    tree.add(&[Fxd::from_num(20), Fxd::from_num(30), Fxd::from_num(60)], 102);

    let within = tree.within::<SquaredEuclidean>(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], Fxd::from_num(10));

    assert_eq!(within.len(), 2);
Source§

impl<'a, A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source

pub fn within_unsorted_iter<D>( &'a self, query: &'a [A; K], dist: A, ) -> WithinUnsortedIter<'a, A, T>
where D: DistanceMetric<A, K>,

Finds all elements within dist of query, using the specified distance metric function.

Only available on x86_64 and aarch64 target architectures (this is due to a dependency on the generator crate). Returns an Iterator. Results are returned in arbitrary order. Faster than within.

§Examples
    use fixed::FixedU16;
    use fixed::types::extra::U0;
    use kiddo::fixed::kdtree::KdTree;
    use kiddo::fixed::distance::SquaredEuclidean;

    type Fxd = FixedU16<U0>;


    let mut tree: KdTree<Fxd, u32, 3, 32, u32> = KdTree::new();

    tree.add(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], 100);
    tree.add(&[Fxd::from_num(2), Fxd::from_num(3), Fxd::from_num(6)], 101);
    tree.add(&[Fxd::from_num(20), Fxd::from_num(30), Fxd::from_num(60)], 102);

    let within = tree.within_unsorted_iter::<SquaredEuclidean>(&[Fxd::from_num(1), Fxd::from_num(2), Fxd::from_num(5)], Fxd::from_num(10)).collect::<Vec<_>>();

    assert_eq!(within.len(), 2);

Trait Implementations§

Source§

impl<A: Clone + Copy + Default, T: Clone + Copy + Default, const K: usize, const B: usize, IDX: Clone> Clone for KdTree<A, T, K, B, IDX>

Source§

fn clone(&self) -> KdTree<A, T, K, B, IDX>

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

impl<A: Debug + Copy + Default, T: Debug + Copy + Default, const K: usize, const B: usize, IDX: Debug> Debug for KdTree<A, T, K, B, IDX>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<A, T, const K: usize, const B: usize, IDX> Default for KdTree<A, T, K, B, IDX>
where A: Axis, T: Content, IDX: Index<T = IDX>, usize: Cast<IDX>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, A, T, const K: usize, const B: usize, IDX> Deserialize<'de> for KdTree<A, T, K, B, IDX>
where A: Deserialize<'de> + Copy + Default, T: Deserialize<'de> + Copy + Default, IDX: Deserialize<'de>,

Source§

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

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

impl<'a, 't, A: Axis + Copy, T: Content + Copy, const K: usize, const B: usize, IDX: Index<T = IDX>> Extend<(&'a [A; K], &'t T)> for KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source§

fn extend<I: IntoIterator<Item = (&'a [A; K], &'t T)>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one #72631)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one #72631)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> Extend<([A; K], T)> for KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source§

fn extend<I: IntoIterator<Item = ([A; K], T)>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one #72631)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one #72631)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>, const N: usize> From<[([A; K], T); N]> for KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source§

fn from(value: [([A; K], T); N]) -> Self

Converts to this type from the input type.
Source§

impl<A: Axis, T: Content, const K: usize, const B: usize, IDX: Index<T = IDX>> FromIterator<([A; K], T)> for KdTree<A, T, K, B, IDX>
where usize: Cast<IDX>,

Source§

fn from_iter<I: IntoIterator<Item = ([A; K], T)>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<A: PartialEq + Copy + Default, T: PartialEq + Copy + Default, const K: usize, const B: usize, IDX: PartialEq> PartialEq for KdTree<A, T, K, B, IDX>

Source§

fn eq(&self, other: &KdTree<A, T, K, B, IDX>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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

impl<A, T, const K: usize, const B: usize, IDX> Serialize for KdTree<A, T, K, B, IDX>
where A: Serialize + Copy + Default, T: Serialize + Copy + Default, IDX: Serialize,

Source§

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

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

impl<A: Copy + Default, T: Copy + Default, const K: usize, const B: usize, IDX> StructuralPartialEq for KdTree<A, T, K, B, IDX>

Auto Trait Implementations§

§

impl<A, T, const K: usize, const B: usize, IDX> Freeze for KdTree<A, T, K, B, IDX>
where IDX: Freeze, T: Freeze,

§

impl<A, T, const K: usize, const B: usize, IDX> RefUnwindSafe for KdTree<A, T, K, B, IDX>

§

impl<A, T, const K: usize, const B: usize, IDX> Send for KdTree<A, T, K, B, IDX>
where IDX: Send, T: Send, A: Send,

§

impl<A, T, const K: usize, const B: usize, IDX> Sync for KdTree<A, T, K, B, IDX>
where IDX: Sync, T: Sync, A: Sync,

§

impl<A, T, const K: usize, const B: usize, IDX> Unpin for KdTree<A, T, K, B, IDX>
where IDX: Unpin, T: Unpin, A: Unpin,

§

impl<A, T, const K: usize, const B: usize, IDX> UnwindSafe for KdTree<A, T, K, B, IDX>
where IDX: UnwindSafe, T: UnwindSafe, A: 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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dst. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

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
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> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

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