pub struct u1(_);
Expand description

An unsigned integer which contains 1 bits

Implementations

The largest value that can be stored

The smallest value that can be stored

Create a new u1 from an inner value

This method does not do any checks that the value passed is valid. To check that, use the u1::new function.

Safety

The value must be valid value of the given type.

Create a new u1 from an inner value

This method checks that the inner value is valid, and return None if it isn’t.

Get the stored value

The 1-bit representation of true (1)

The 1-bit representation of false (0)

Get the opposite of this value (i.e. TRUE <–> FALSE)

Trait Implementations

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the & operator.
Performs the & operation. Read more
Performs the &= operation. Read more

The number of bits this type takes up

Note that this is the conceptual amount it needs in a bit struct, not the amount it will use as its own variable on the stack.

The resulting type after applying the | operator.
Performs the | operation. Read more
Performs the |= operation. Read more
The resulting type after applying the ^ operator.
Performs the ^ operation. Read more
Performs the ^= operation. Read more
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Fits self into the target type
Returns the smallest finite number this type can represent
Returns the largest finite number this type can represent
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the / operator.
Performs the / operation. Read more
The type this field stores as
Get the raw representation of this value
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
The resulting type after applying the * operator.
Performs the * operation. Read more
Convert from a string and radix (typically 2..=36). Read more
Returns the multiplicative identity element of Self, 1. Read more
Sets self to the multiplicative identity element of Self, 1.
Returns true if self is equal to the multiplicative identity. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
The resulting type after applying the % operator.
Performs the % operation. Read more
Serialize this value into the given Serde serializer. Read more
The resulting type after applying the << operator.
Performs the << operation. Read more
Performs the <<= operation. Read more
The resulting type after applying the >> operator.
Performs the >> operation. Read more
Performs the >>= operation. Read more
The resulting type after applying the - operator.
Performs the - operation. Read more
Set this to true if, at compile-time, we can tell that all bit representations which contain the appropriate number of bits are valid representations of this type Read more
Return whether or not the underlying bits of P are valid representation of this type Read more
Returns the additive identity element of Self, 0. Read more
Returns true if self is equal to the additive identity.
Sets self to the additive identity element of Self, 0.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Get a zero value for this bit struct
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Returns the smallest finite number this type can represent
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Returns the largest finite number this type can represent