pub struct Unsigned;Expand description
Storage unsigned integers in slices.
For a bit count of NBITS, the Unsigned type can store unsigned integers in
the range [0, 2^NBITS - 1].
Implementations§
Source§impl Unsigned
impl Unsigned
Sourcepub const fn domain_const<const NBITS: usize>() -> RangeInclusive<i64>
pub const fn domain_const<const NBITS: usize>() -> RangeInclusive<i64>
Return the dynamic range of an Unsigned encoding for NBITS.
Trait Implementations§
Source§impl Representation<1> for Unsigned
impl Representation<1> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<2> for Unsigned
impl Representation<2> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<3> for Unsigned
impl Representation<3> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<4> for Unsigned
impl Representation<4> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<5> for Unsigned
impl Representation<5> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<6> for Unsigned
impl Representation<6> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<7> for Unsigned
impl Representation<7> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreSource§impl Representation<8> for Unsigned
impl Representation<8> for Unsigned
Source§type Domain = RangeInclusive<i64>
type Domain = RangeInclusive<i64>
The type of the domain accepted by this representation.
Source§fn encode(value: i64) -> Result<u8, EncodingError>
fn encode(value: i64) -> Result<u8, EncodingError>
Encode
value into the lower order bits of a byte. Returns the encoded value on
success, or an EncodingError if the value is unencodable.Source§fn encode_unchecked(value: i64) -> u8
fn encode_unchecked(value: i64) -> u8
Encode
value into the lower order bits of a byte without checking if value
is encodable. This function is not marked as unsafe because in-and-of itself, it
won’t cause memory safety issues. Read moreimpl Copy for Unsigned
Auto Trait Implementations§
impl Freeze for Unsigned
impl RefUnwindSafe for Unsigned
impl Send for Unsigned
impl Sync for Unsigned
impl Unpin for Unsigned
impl UnwindSafe for Unsigned
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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