pub struct Duration<const US: u32 = 625>(/* private fields */);
Expand description
A 16-bit duration. The US
generic parameter indicates the timebase in µs.
Implementations§
Source§impl<const US: u32> Duration<US>
impl<const US: u32> Duration<US>
Sourcepub fn from_micros(val: u64) -> Self
pub fn from_micros(val: u64) -> Self
Create an instance from microseconds.
Sourcepub fn from_millis(val: u32) -> Self
pub fn from_millis(val: u32) -> Self
Create an instance from milliseconds.
Trait Implementations§
Source§impl<const US: u32> FixedSizeValue for Duration<US>
impl<const US: u32> FixedSizeValue for Duration<US>
Source§impl From<Duration<1000000>> for LeSetResolvablePrivateAddrTimeout
impl From<Duration<1000000>> for LeSetResolvablePrivateAddrTimeout
Source§impl<const US: u32> Ord for Duration<US>
impl<const US: u32> Ord for Duration<US>
1.21.0 · 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
Source§impl<const US: u32> PartialOrd for Duration<US>
impl<const US: u32> PartialOrd for Duration<US>
impl<const US: u32> Copy for Duration<US>
impl<const US: u32> Eq for Duration<US>
impl<const US: u32> StructuralPartialEq for Duration<US>
Auto Trait Implementations§
impl<const US: u32> Freeze for Duration<US>
impl<const US: u32> RefUnwindSafe for Duration<US>
impl<const US: u32> Send for Duration<US>
impl<const US: u32> Sync for Duration<US>
impl<const US: u32> Unpin for Duration<US>
impl<const US: u32> UnwindSafe for Duration<US>
Blanket Implementations§
Source§impl<T> AsHciBytes for Twhere
T: FixedSizeValue,
impl<T> AsHciBytes for Twhere
T: FixedSizeValue,
Source§fn as_hci_bytes(&self) -> &[u8]
fn as_hci_bytes(&self) -> &[u8]
Get the byte representation of this type.
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<'de, T> FromHciBytes<'de> for Twhere
T: FixedSizeValue,
impl<'de, T> FromHciBytes<'de> for Twhere
T: FixedSizeValue,
Source§fn from_hci_bytes(data: &'de [u8]) -> Result<(T, &'de [u8]), FromHciBytesError>
fn from_hci_bytes(data: &'de [u8]) -> Result<(T, &'de [u8]), FromHciBytesError>
Deserialize bytes into a HCI type, return additional bytes.
Source§fn from_hci_bytes_complete(data: &'de [u8]) -> Result<Self, FromHciBytesError>
fn from_hci_bytes_complete(data: &'de [u8]) -> Result<Self, FromHciBytesError>
Deserialize bytes into a HCI type, must consume all bytes.
Source§impl<'de, T> ReadHci<'de> for Twhere
T: FixedSizeValue,
impl<'de, T> ReadHci<'de> for Twhere
T: FixedSizeValue,
Source§const MAX_LEN: usize = const MAX_LEN: usize = core::mem::size_of::<Self>();
const MAX_LEN: usize = const MAX_LEN: usize = core::mem::size_of::<Self>();
Max length read by this type.
Source§fn read_hci<R>(
reader: R,
buf: &'de mut [u8],
) -> Result<T, ReadHciError<<R as ErrorType>::Error>>where
R: Read,
fn read_hci<R>(
reader: R,
buf: &'de mut [u8],
) -> Result<T, ReadHciError<<R as ErrorType>::Error>>where
R: Read,
Read this type from the provided reader.
Source§async fn read_hci_async<R>(
reader: R,
buf: &'de mut [u8],
) -> Result<T, ReadHciError<<R as ErrorType>::Error>>where
R: Read,
async fn read_hci_async<R>(
reader: R,
buf: &'de mut [u8],
) -> Result<T, ReadHciError<<R as ErrorType>::Error>>where
R: Read,
Read this type from the provided reader, async version.