pub struct TypeSize(/* private fields */);Expand description
Byte size of a fixed-bytes, integer, or fixed-point number (M) type. Valid values: 0..=32.
Implementations§
Source§impl TypeSize
impl TypeSize
Sourcepub const ZERO: Self
pub const ZERO: Self
The value zero. Note that this is not a valid size for a fixed-bytes type.
Sourcepub fn new_int_bits(bits: u16) -> Self
pub fn new_int_bits(bits: u16) -> Self
Creates a new TypeSize from a u8 number of bits.
Panics if bits is not a multiple of 8 or greater than 256.
Sourcepub fn try_new_int_bits(bits: u16) -> Option<Self>
pub fn try_new_int_bits(bits: u16) -> Option<Self>
Creates a new TypeSize for an integer type.
Returns None if bits is not a multiple of 8 or greater than 256.
Sourcepub fn new_fb_bytes(bytes: u8) -> Self
pub fn new_fb_bytes(bytes: u8) -> Self
Creates a new TypeSize for a fixed-bytes type.
Panics if bytes is not in the range 1..=32.
Sourcepub fn try_new_fb_bytes(bytes: u8) -> Option<Self>
pub fn try_new_fb_bytes(bytes: u8) -> Option<Self>
Creates a new TypeSize for a fixed-bytes type.
Returns None if bytes is not in the range 1..=32.
Sourcepub const fn int_keyword(self) -> Symbol
pub const fn int_keyword(self) -> Symbol
Returns the int symbol for the type name.
Sourcepub const fn uint_keyword(self) -> Symbol
pub const fn uint_keyword(self) -> Symbol
Returns the uint symbol for the type name.
Sourcepub const fn bytes_keyword(self) -> Symbol
pub const fn bytes_keyword(self) -> Symbol
Trait Implementations§
Source§impl Ord for TypeSize
impl Ord for TypeSize
Source§impl PartialOrd for TypeSize
impl PartialOrd for TypeSize
impl Copy for TypeSize
impl Eq for TypeSize
impl StructuralPartialEq for TypeSize
Auto Trait Implementations§
impl Freeze for TypeSize
impl RefUnwindSafe for TypeSize
impl Send for TypeSize
impl Sync for TypeSize
impl Unpin for TypeSize
impl UnwindSafe for TypeSize
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
fn to_owned_equivalent(&self) -> <Q as ToOwned>::Owned
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte