Struct tuplez::Unit

source ·
pub struct Unit;
Expand description

The unit type that represents tuples of zero elements.

Compared with Tuple type, the unit type does not implement the Popable trait.

Suggestion: Use the parameterless tuple! macro to create a unit:

use tuplez::*;
let unit = tuple!();

Trait Implementations§

source§

impl Add for Unit

§

type Output = Unit

The resulting type after applying the + operator.
source§

fn add(self, _: Unit) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign for Unit

source§

fn add_assign(&mut self, _: Unit)

Performs the += operation. Read more
source§

impl BitAnd for Unit

§

type Output = Unit

The resulting type after applying the & operator.
source§

fn bitand(self, _: Unit) -> Self::Output

Performs the & operation. Read more
source§

impl BitAndAssign for Unit

source§

fn bitand_assign(&mut self, _: Unit)

Performs the &= operation. Read more
source§

impl BitOr for Unit

§

type Output = Unit

The resulting type after applying the | operator.
source§

fn bitor(self, _: Unit) -> Self::Output

Performs the | operation. Read more
source§

impl BitOrAssign for Unit

source§

fn bitor_assign(&mut self, _: Unit)

Performs the |= operation. Read more
source§

impl BitXor for Unit

§

type Output = Unit

The resulting type after applying the ^ operator.
source§

fn bitxor(self, _: Unit) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXorAssign for Unit

source§

fn bitxor_assign(&mut self, _: Unit)

Performs the ^= operation. Read more
source§

impl Clone for Unit

source§

fn clone(&self) -> Unit

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 Debug for Unit

source§

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

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

impl Default for Unit

source§

fn default() -> Unit

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

impl Div for Unit

§

type Output = Unit

The resulting type after applying the / operator.
source§

fn div(self, _: Unit) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign for Unit

source§

fn div_assign(&mut self, _: Unit)

Performs the /= operation. Read more
source§

impl<F> Foreach<F> for Unit

§

type Output = Unit

The type of tuple generated by traversing the tuple.
source§

fn foreach(self, _: &mut F) -> Self::Output

Traverse the tuple by immutable references to its elements, and collect the output of traversal into a new tuple. Read more
source§

impl<T> From<[T; 0]> for Unit

source§

fn from(_: [T; 0]) -> Self

Converts to this type from the input type.
source§

impl From<()> for Unit

source§

fn from(prim: ()) -> Self

Converts to this type from the input type.
source§

impl Hash for Unit

source§

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

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

impl Mul for Unit

§

type Output = Unit

The resulting type after applying the * operator.
source§

fn mul(self, _: Unit) -> Self::Output

Performs the * operation. Read more
source§

impl MulAssign for Unit

source§

fn mul_assign(&mut self, _: Unit)

Performs the *= operation. Read more
source§

impl Neg for Unit

§

type Output = Unit

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Not for Unit

§

type Output = Unit

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for Unit

source§

fn cmp(&self, other: &Unit) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Unit

source§

fn eq(&self, other: &Unit) -> 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.
source§

impl PartialOrd for Unit

source§

fn partial_cmp(&self, other: &Unit) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem for Unit

§

type Output = Unit

The resulting type after applying the % operator.
source§

fn rem(self, _: Unit) -> Self::Output

Performs the % operation. Read more
source§

impl RemAssign for Unit

source§

fn rem_assign(&mut self, _: Unit)

Performs the %= operation. Read more
source§

impl Rotatable for Unit

§

type RotLeftOutput = Unit

The type of tuple generated by left rorating the elements of the tuple.
§

type RotRightOutput = Unit

The type of tuple generated by right rotating the elements of the tuple.
source§

fn rot_l(self) -> Unit

Left rotates the elements of the tuple. Read more
source§

fn rot_r(self) -> Unit

Right rotates the elements of the tuple. Read more
source§

impl Shl for Unit

§

type Output = Unit

The resulting type after applying the << operator.
source§

fn shl(self, _: Unit) -> Self::Output

Performs the << operation. Read more
source§

impl ShlAssign for Unit

source§

fn shl_assign(&mut self, _: Unit)

Performs the <<= operation. Read more
source§

impl Shr for Unit

§

type Output = Unit

The resulting type after applying the >> operator.
source§

fn shr(self, _: Unit) -> Self::Output

Performs the >> operation. Read more
source§

impl ShrAssign for Unit

source§

fn shr_assign(&mut self, _: Unit)

Performs the >>= operation. Read more
source§

impl Sub for Unit

§

type Output = Unit

The resulting type after applying the - operator.
source§

fn sub(self, _: Unit) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign for Unit

source§

fn sub_assign(&mut self, _: Unit)

Performs the -= operation. Read more
source§

impl<T> ToArray<T> for Unit

§

type Array = [T; 0]

The primitive array type to generate.
source§

fn to_array(self) -> Self::Array

Converts the tuple to the primitive array.
source§

impl ToPrimitive for Unit

§

type Primitive = ()

The primitive tuple type containing the same number and order of elements.
source§

fn primitive(self) -> Self::Primitive

Converts the tuple to the primitive tuple. Read more
source§

impl TupleLike for Unit

§

type AsRefOutput<'a> = Unit

The type of tuple containing immutable references to all elements of the tuple.
§

type AsMutOutput<'a> = Unit

The type of tuple containing mutable references to all elements of the tuple.
§

type PushFrontOutput<T> = Tuple<T, Unit>

The type of tuple generated by pushing an element to the front of the tuple.
§

type PushBackOutput<T> = Tuple<T, Unit>

The type of tuple generated by pushing an element to the back of the tuple.
§

type RevOutput = Unit

The type of tuple generated by reversing the tuple.
§

type JoinOutput<T> = T where T: TupleLike

The type of tuple generated by joining two tuples.
§

type ToSomeOutput = Unit

The type of tuple after wrapping all elements into Option.
§

type ToOkOutput<E> = Unit

The type of tuple after wrapping all elements into Result.
source§

const LEN: usize = 0usize

The number of elements in the tuple.
source§

fn as_ref(&self) -> Self::AsRefOutput<'_>

Generate a tuple containing immutable references to all elements of the tuple. Read more
source§

fn as_mut(&mut self) -> Self::AsMutOutput<'_>

Generate a tuple containing mutable reference to all elements of the tuple. Read more
source§

fn push<T>(self, value: T) -> Self::PushBackOutput<T>

Push an element to the back of the tuple. Read more
source§

fn push_front<T>(self, value: T) -> Self::PushFrontOutput<T>

Push an element to the front of the tuple. Read more
source§

fn push_back<T>(self, value: T) -> Self::PushBackOutput<T>

Push an element to the back of the tuple. Same as push().
source§

fn rev(self) -> Self::RevOutput

Reverse elements of the tuple. Read more
source§

fn join<T>(self, value: T) -> Self::JoinOutput<T>
where T: TupleLike,

Join two tuples. Read more
source§

fn to_some(self) -> Self::ToSomeOutput

Convert a tuple!(a, b, c ...) to tuple!(Some(a), Some(b), Some(c) ...). Read more
source§

fn to_ok<E>(self) -> Self::ToOkOutput<E>

Convert a tuple!(a, b, c ...) to tuple!(Ok(a), Ok(b), Ok(c) ...). Read more
source§

fn len(&self) -> usize

Returns the number of elements in the tuple. MUST always return LEN. Read more
source§

impl Unwrap for Unit

§

type Output = Unit

Type of the contained value.
source§

fn unwrap(self) -> Self::Output

Get the contained value. Read more
source§

fn has_value(&self) -> bool

Check if self contains a value. Read more
source§

impl UnwrapOrDefault for Unit

§

type Output = Unit

Type of the contained value.
source§

fn unwrap_or_default(self) -> Self::Output

Get the contained value, or the default value if self does not contain a value. Read more
source§

impl Copy for Unit

source§

impl Eq for Unit

source§

impl StructuralPartialEq for Unit

Auto Trait Implementations§

§

impl RefUnwindSafe for Unit

§

impl Send for Unit

§

impl Sync for Unit

§

impl Unpin for Unit

§

impl UnwindSafe for Unit

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