Struct HomoPair

Source
pub struct HomoPair<T>(pub T, pub T);
Expand description

Type constructor to wrap pair of the same type.

§Sample

let two_i32_in_tuple = type_constructor::HomoPair::< i32 >::from( ( 13, 31 ) );
dbg!( two_i32_in_tuple );
// vec_of_i32_in_tuple = HomoPair( 13, 31 )

Tuple Fields§

§0: T§1: T

Trait Implementations§

Source§

impl<T> AsArray<T, 2> for HomoPair<T>

Source§

fn as_array(&self) -> &[T; 2]

Reinterpret as array.
Source§

impl<T> AsSlice<T> for HomoPair<T>

Source§

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

Reinterpret as slice.
Source§

impl<T> AsTuple<(T, T)> for HomoPair<T>

Source§

fn as_tuple(&self) -> &(T, T)

Reinterpret as tuple.
Source§

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

Source§

fn clone(&self) -> HomoPair<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> CloneAsArray<T, 2> for HomoPair<T>
where T: Clone,

Source§

fn clone_as_array(&self) -> [T; 2]

Clone as array.
Source§

impl<T> CloneAsTuple<(T, T)> for HomoPair<T>
where T: Clone,

Source§

fn clone_as_tuple(&self) -> (T, T)

Clone as tuple.
Source§

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

Source§

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

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

impl<T> Default for HomoPair<T>
where T: Default,

Source§

fn default() -> HomoPair<T>

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

impl<T> Deref for HomoPair<T>

Source§

type Target = (T, T)

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<HomoPair<T> as Deref>::Target

Dereferences the value.
Source§

impl<T> DerefMut for HomoPair<T>

Source§

fn deref_mut(&mut self) -> &mut <HomoPair<T> as Deref>::Target

Mutably dereferences the value.
Source§

impl<T> From<&[T]> for HomoPair<T>
where T: Clone,

Source§

fn from(src: &[T]) -> HomoPair<T>

Converts to this type from the input type.
Source§

impl<T> From<[T; 2]> for HomoPair<T>
where T: Clone,

Source§

fn from(src: [T; 2]) -> HomoPair<T>

Converts to this type from the input type.
Source§

impl<T> From<(T, T)> for HomoPair<T>

Source§

fn from(src: (T, T)) -> HomoPair<T>

Converts to this type from the input type.
Source§

impl<T> From<HomoPair<T>> for (T, T)

Source§

fn from(src: HomoPair<T>) -> (T, T)

Converts to this type from the input type.
Source§

impl<T> From<T> for HomoPair<T>
where T: Clone,

Source§

fn from(src: T) -> HomoPair<T>

Converts to this type from the input type.
Source§

impl<T> Make0 for HomoPair<T>
where T: Default,

Source§

fn make_0() -> HomoPair<T>

Constructor without arguments.
Source§

fn make() -> Self

Constructor without arguments.
Source§

impl<T> Make1<T> for HomoPair<T>
where T: Clone,

Source§

fn make_1(_0: T) -> HomoPair<T>

Constructor without arguments.
Source§

fn make(arg: Arg) -> Self

Constructor without arguments.
Source§

impl<T> Make2<T, T> for HomoPair<T>

Source§

fn make_2(_0: T, _1: T) -> HomoPair<T>

Constructor with two arguments.
Source§

fn make(arg1: Arg1, arg2: Arg2) -> Self

Constructor with two arguments.
Source§

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

Source§

fn eq(&self, other: &HomoPair<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> Eq for HomoPair<T>
where T: Eq,

Source§

impl<T> StructuralPartialEq for HomoPair<T>

Auto Trait Implementations§

§

impl<T> Freeze for HomoPair<T>
where T: Freeze,

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for HomoPair<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
Source§

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

Source§

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

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

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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<Target, Original> VectorizedInto<Target> for Original
where Target: VectorizedFrom<Original>,

Source§

fn vectorized_into(self) -> Target

Performs the conversion.