pub struct SB51(/* private fields */);Expand description
a type used to represent a field with a specific amount of bits.
Implementations§
Source§impl SB51
impl SB51
pub const fn from_fields(fields: Self) -> Self
pub const fn to_fields(x: Self) -> Self
pub const fn try_from_bits( bits: <BitLength<51> as AssociatedStorage>::Storage, ) -> Option<Self>
pub const fn from_bits( bits: <BitLength<51> as AssociatedStorage>::Storage, ) -> Self
pub const fn to_bits(self) -> <BitLength<51> as AssociatedStorage>::Storage
pub const fn const_eq(a: Self, b: Self) -> bool
Source§impl SB51
impl SB51
Sourcepub const fn new(
value: <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed,
) -> Self
pub const fn new( value: <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed, ) -> Self
creates a new instance of this bitfield type with the given value.
this function panics if the value does not fit within the bit length of this type.
Sourcepub const fn try_new(
value: <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed,
) -> Option<Self>
pub const fn try_new( value: <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed, ) -> Option<Self>
creates a new instance of this bitfield type with the given value.
if the value does not fit within the bit length of this type, returns None.
Sourcepub const unsafe fn new_unchecked(
value: <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed,
) -> Self
pub const unsafe fn new_unchecked( value: <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed, ) -> Self
creates a new instance of this bitfield type with the given value, without checking that the value fits within the bit length of this type.
§Safety
the provided value must fit within the bit length of this type.
Sourcepub const fn get(
&self,
) -> <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed
pub const fn get( &self, ) -> <<BitLength<51> as AssociatedStorage>::Storage as BitStorage>::Signed
returns the inner value.
Trait Implementations§
Source§impl BitPiece for SB51
impl BitPiece for SB51
Source§type Bits = <BitLength<51> as AssociatedStorage>::Storage
type Bits = <BitLength<51> as AssociatedStorage>::Storage
the storage type used internally to store the bits of this bitpiece.
Source§type Converter = SB51
type Converter = SB51
a converter types which implements all const conversion functions (e.g
from_bits). Read morefn try_from_bits(bits: Self::Bits) -> Option<Self>
fn from_bits(bits: Self::Bits) -> Self
fn to_bits(self) -> Self::Bits
Source§impl BitPieceHasFields for SB51
impl BitPieceHasFields for SB51
Source§impl BitPieceHasMutRef for SB51
impl BitPieceHasMutRef for SB51
Source§type MutRef<'s> = SB51MutRef<'s>
type MutRef<'s> = SB51MutRef<'s>
the type used to represent a mutable reference to this type inside another bitpiece.
impl Copy for SB51
impl Eq for SB51
Source§impl Ord for SB51
impl Ord for SB51
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for SB51
impl PartialOrd for SB51
impl StructuralPartialEq for SB51
Auto Trait Implementations§
impl Freeze for SB51
impl RefUnwindSafe for SB51
impl Send for SB51
impl Sync for SB51
impl Unpin for SB51
impl UnsafeUnpin for SB51
impl UnwindSafe for SB51
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