Struct BinningWithWidth

Source
pub struct BinningWithWidth<T>{ /* private fields */ }
Expand description

Generic binning meant for any integer type

Implementations§

Source§

impl BinningWithWidth<u8>

Source

pub fn new_inclusive( start: u8, end_inclusive: u8, bin_width: u8, ) -> Result<Self, <u8 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> u8

Get left border, inclusive

Source

pub const fn right(&self) -> u8

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<u8>

§Returns the range covered by the bins as a RangeInclusive<u8>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<u8>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<u8>

§Example:
use sampling::histogram::BinningU8;
let binning = BinningU8::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <u8 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<u8>>( &self, val: V, ) -> Option<<u8 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<i8>

Source

pub fn new_inclusive( start: i8, end_inclusive: i8, bin_width: i8, ) -> Result<Self, <i8 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> i8

Get left border, inclusive

Source

pub const fn right(&self) -> i8

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<i8>

§Returns the range covered by the bins as a RangeInclusive<i8>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<i8>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<i8>

§Example:
use sampling::histogram::BinningI8;
let binning = BinningI8::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <i8 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<i8>>( &self, val: V, ) -> Option<<i8 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<u16>

Source

pub fn new_inclusive( start: u16, end_inclusive: u16, bin_width: u16, ) -> Result<Self, <u16 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> u16

Get left border, inclusive

Source

pub const fn right(&self) -> u16

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<u16>

§Returns the range covered by the bins as a RangeInclusive<u16>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<u16>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<u16>

§Example:
use sampling::histogram::BinningU16;
let binning = BinningU16::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <u16 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<u16>>( &self, val: V, ) -> Option<<u16 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<i16>

Source

pub fn new_inclusive( start: i16, end_inclusive: i16, bin_width: i16, ) -> Result<Self, <i16 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> i16

Get left border, inclusive

Source

pub const fn right(&self) -> i16

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<i16>

§Returns the range covered by the bins as a RangeInclusive<i16>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<i16>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<i16>

§Example:
use sampling::histogram::BinningI16;
let binning = BinningI16::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <i16 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<i16>>( &self, val: V, ) -> Option<<i16 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<u32>

Source

pub fn new_inclusive( start: u32, end_inclusive: u32, bin_width: u32, ) -> Result<Self, <u32 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> u32

Get left border, inclusive

Source

pub const fn right(&self) -> u32

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<u32>

§Returns the range covered by the bins as a RangeInclusive<u32>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<u32>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<u32>

§Example:
use sampling::histogram::BinningU32;
let binning = BinningU32::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <u32 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<u32>>( &self, val: V, ) -> Option<<u32 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<i32>

Source

pub fn new_inclusive( start: i32, end_inclusive: i32, bin_width: i32, ) -> Result<Self, <i32 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> i32

Get left border, inclusive

Source

pub const fn right(&self) -> i32

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<i32>

§Returns the range covered by the bins as a RangeInclusive<i32>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<i32>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<i32>

§Example:
use sampling::histogram::BinningI32;
let binning = BinningI32::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <i32 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<i32>>( &self, val: V, ) -> Option<<i32 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<u64>

Source

pub fn new_inclusive( start: u64, end_inclusive: u64, bin_width: u64, ) -> Result<Self, <u64 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> u64

Get left border, inclusive

Source

pub const fn right(&self) -> u64

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<u64>

§Returns the range covered by the bins as a RangeInclusive<u64>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<u64>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<u64>

§Example:
use sampling::histogram::BinningU64;
let binning = BinningU64::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <u64 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<u64>>( &self, val: V, ) -> Option<<u64 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<i64>

Source

pub fn new_inclusive( start: i64, end_inclusive: i64, bin_width: i64, ) -> Result<Self, <i64 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> i64

Get left border, inclusive

Source

pub const fn right(&self) -> i64

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<i64>

§Returns the range covered by the bins as a RangeInclusive<i64>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<i64>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<i64>

§Example:
use sampling::histogram::BinningI64;
let binning = BinningI64::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <i64 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<i64>>( &self, val: V, ) -> Option<<i64 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<u128>

Source

pub fn new_inclusive( start: u128, end_inclusive: u128, bin_width: u128, ) -> Result<Self, <u128 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> u128

Get left border, inclusive

Source

pub const fn right(&self) -> u128

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<u128>

§Returns the range covered by the bins as a RangeInclusive<u128>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<u128>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<u128>

§Example:
use sampling::histogram::BinningU128;
let binning = BinningU128::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <u128 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<u128>>( &self, val: V, ) -> Option<<u128 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<i128>

Source

pub fn new_inclusive( start: i128, end_inclusive: i128, bin_width: i128, ) -> Result<Self, <i128 as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> i128

Get left border, inclusive

Source

pub const fn right(&self) -> i128

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<i128>

§Returns the range covered by the bins as a RangeInclusive<i128>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<i128>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<i128>

§Example:
use sampling::histogram::BinningI128;
let binning = BinningI128::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <i128 as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<i128>>( &self, val: V, ) -> Option<<i128 as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<usize>

Source

pub fn new_inclusive( start: usize, end_inclusive: usize, bin_width: usize, ) -> Result<Self, <usize as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> usize

Get left border, inclusive

Source

pub const fn right(&self) -> usize

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<usize>

§Returns the range covered by the bins as a RangeInclusive<usize>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<usize>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<usize>

§Example:
use sampling::histogram::BinningUSIZE;
let binning = BinningUSIZE::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <usize as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<usize>>( &self, val: V, ) -> Option<<usize as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned
Source§

impl BinningWithWidth<isize>

Source

pub fn new_inclusive( start: isize, end_inclusive: isize, bin_width: isize, ) -> Result<Self, <isize as HasUnsignedVersion>::Unsigned>

§Create a new Binning
  • both borders are inclusive
  • each bin has width bin_width
§Panics
  • if start is smaller than end_inclusive
  • if bin_width <= 0
§Err

Result is Err if start and end are mismatched with the bin_width, i.e., it is impossible to create the binning due to the integer nature of our types

Source

pub const fn left(&self) -> isize

Get left border, inclusive

Source

pub const fn right(&self) -> isize

Get right border, inclusive

Source

pub const fn range_inclusive(&self) -> RangeInclusive<isize>

§Returns the range covered by the bins as a RangeInclusive<isize>
Source

pub fn native_bin_iter(&self) -> impl Iterator<Item = RangeInclusive<isize>>

§Iterator over all the bins

Here the bins are represented as RangeInclusive<isize>

§Example:
use sampling::histogram::BinningISIZE;
let binning = BinningISIZE::new_inclusive(2,7,2).unwrap();
let vec: Vec<_> = binning.native_bin_iter().collect();
assert_eq!(&vec, &[(2..=3), (4..=5), (6..=7)]);
Source

pub fn bins_m1(&self) -> <isize as HasUnsignedVersion>::Unsigned

§The amount of bins -1
  • minus 1 because if the bins are of width 1 and are going over the entire range of the type, then we cannot represent the number of bins as this type
§Example

If we look at an u8 and the range from 0 to 255, then this is 256 bins, which cannot be represented as u8. To combat this, I return bins - 1. This works, because we always have at least 1 bin

Source

pub fn get_bin_index_native<V: Borrow<isize>>( &self, val: V, ) -> Option<<isize as HasUnsignedVersion>::Unsigned>

§Get the respective bin in native unsigned

Trait Implementations§

Source§

impl<T> Clone for BinningWithWidth<T>

Source§

fn clone(&self) -> BinningWithWidth<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
Source§

impl<T> Debug for BinningWithWidth<T>

Source§

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

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

impl<'de, T> Deserialize<'de> for BinningWithWidth<T>

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<T> PartialEq for BinningWithWidth<T>

Source§

fn eq(&self, other: &BinningWithWidth<T>) -> 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<T> Serialize for BinningWithWidth<T>

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<T> Eq for BinningWithWidth<T>
where T: HasUnsignedVersion + Eq, T::Unsigned: Eq,

Source§

impl<T> StructuralPartialEq for BinningWithWidth<T>

Auto Trait Implementations§

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
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)
Performs copy-assignment from self to dst. Read more
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
§

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

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

§

fn vzip(self) -> V

Source§

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