pub enum SpinelUint {}
Expand description
Marker type used to specify integers encoded with Spinel’s variable-length unsigned integer encoding.
This type is necessary because u32
is defined to mean a fixed-length
encoding, whereas this type can be encoded with a variable length.
This type has no size and is used only with the TryPackAs
/TryUnpackAs
traits
and in the base type for TryUnpack
/TryOwnedUnpack
.
Trait Implementations§
Source§impl Debug for SpinelUint
impl Debug for SpinelUint
Source§impl TryOwnedUnpack for SpinelUint
impl TryOwnedUnpack for SpinelUint
Source§type Unpacked = u32
type Unpacked = u32
The type of the unpacked result. This can be the same as
Self
,
but in some cases it can be different. This is because Self
is
a marker type, and may not even be Sized
. For example, if Self
is
SpinelUint
, then Unpacked
would be u32
(because SpinelUint
is just
a marker trait indicating a variably-sized unsigned integer).Source§fn try_owned_unpack(iter: &mut Iter<'_, u8>) -> Result<Self::Unpacked>
fn try_owned_unpack(iter: &mut Iter<'_, u8>) -> Result<Self::Unpacked>
Attempts to decode the data at the given iterator into an instance
of
Self
, where Self
must be an “owned” type.Source§impl TryPackAs<SpinelUint> for u32
impl TryPackAs<SpinelUint> for u32
Source§impl<'a> TryUnpack<'a> for SpinelUint
impl<'a> TryUnpack<'a> for SpinelUint
Source§type Unpacked = <SpinelUint as TryOwnedUnpack>::Unpacked
type Unpacked = <SpinelUint as TryOwnedUnpack>::Unpacked
The type of the unpacked result. This can be the same as
Self
,
but in some cases it can be different. This is because Self
is
a marker type, and may not even be Sized
. For example, if Self
is
SpinelUint
, then Unpacked
would be u32
(because SpinelUint
is just
a marker trait indicating a variably-sized unsigned integer).Source§fn try_unpack(iter: &mut Iter<'a, u8>) -> Result<Self::Unpacked>
fn try_unpack(iter: &mut Iter<'a, u8>) -> Result<Self::Unpacked>
Attempts to decode the data at the given iterator into an instance
of
Self
.Source§impl<'a> TryUnpackAs<'a, SpinelUint> for u32
impl<'a> TryUnpackAs<'a, SpinelUint> for u32
Source§fn try_unpack_as(iter: &mut Iter<'a, u8>) -> Result<Self>
fn try_unpack_as(iter: &mut Iter<'a, u8>) -> Result<Self>
Attempts to decode the data (with a format determined by
Marker
) at the given
iterator into an instance of Self
.Source§fn try_unpack_as_from_slice(slice: &'a [u8]) -> Result<Self>
fn try_unpack_as_from_slice(slice: &'a [u8]) -> Result<Self>
Convenience method for unpacking directly from a borrowed slice.
Auto Trait Implementations§
impl Freeze for SpinelUint
impl RefUnwindSafe for SpinelUint
impl Send for SpinelUint
impl Sync for SpinelUint
impl Unpin for SpinelUint
impl UnwindSafe for SpinelUint
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