Struct ctaphid_types::Message
source · [−]Expand description
A CTAPHID message.
Fields
channel: Channel
The channel this message is sent or received on.
command: Command
The CTAPHID command.
data: T
The message payload.
Implementations
sourceimpl<T: AsRef<[u8]>> Message<T>
impl<T: AsRef<[u8]>> Message<T>
sourceimpl<T: AsRef<[u8]> + Default + Extend<u8>> Message<T>
impl<T: AsRef<[u8]> + Default + Extend<u8>> Message<T>
sourcepub fn from_fragments<S: AsRef<[u8]>>(
packet: InitializationPacket<S>
) -> DefragmentedMessage<T>
pub fn from_fragments<S: AsRef<[u8]>>(
packet: InitializationPacket<S>
) -> DefragmentedMessage<T>
Assembles a CTAPHID message from a sequence of packets, starting with the given initialization packet.
sourcepub fn try_from_fragments<S: AsRef<[u8]>>(
packet: Packet<S>
) -> Result<DefragmentedMessage<T>, DefragmentationError>
pub fn try_from_fragments<S: AsRef<[u8]>>(
packet: Packet<S>
) -> Result<DefragmentedMessage<T>, DefragmentationError>
Tries to assemble a CTAPHID message from a sequence of packets, starting with the given packet.
The packet must be an initialization packet. This is a shorthand for matching the packet
and calling Message::from_fragments
.
Trait Implementations
sourceimpl<T: Ord + AsRef<[u8]>> Ord for Message<T>
impl<T: Ord + AsRef<[u8]>> Ord for Message<T>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialOrd + AsRef<[u8]>> PartialOrd<Message<T>> for Message<T>
impl<T: PartialOrd + AsRef<[u8]>> PartialOrd<Message<T>> for Message<T>
sourcefn partial_cmp(&self, other: &Message<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Message<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T: Copy + AsRef<[u8]>> Copy for Message<T>
impl<T: Eq + AsRef<[u8]>> Eq for Message<T>
impl<T: AsRef<[u8]>> StructuralEq for Message<T>
impl<T: AsRef<[u8]>> StructuralPartialEq for Message<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Message<T> where
T: RefUnwindSafe,
impl<T> Send for Message<T> where
T: Send,
impl<T> Sync for Message<T> where
T: Sync,
impl<T> Unpin for Message<T> where
T: Unpin,
impl<T> UnwindSafe for Message<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more