Struct trezor_client::transport::ProtoMessage
source · pub struct ProtoMessage(pub MessageType, pub Vec<u8>);
Expand description
A protobuf message accompanied by the message type. This type is used to pass messages over the transport and used to contain messages received from the transport.
Tuple Fields§
§0: MessageType
§1: Vec<u8>
Implementations§
source§impl ProtoMessage
impl ProtoMessage
pub fn new(mt: MessageType, payload: Vec<u8>) -> ProtoMessage
pub fn message_type(&self) -> MessageType
pub fn payload(&self) -> &[u8] ⓘ
pub fn into_payload(self) -> Vec<u8>
sourcepub fn into_message<M: Message>(self) -> Result<M, Error>
pub fn into_message<M: Message>(self) -> Result<M, Error>
Take the payload from the ProtoMessage and parse it to a protobuf message.
Auto Trait Implementations§
impl Freeze for ProtoMessage
impl RefUnwindSafe for ProtoMessage
impl Send for ProtoMessage
impl Sync for ProtoMessage
impl Unpin for ProtoMessage
impl UnwindSafe for ProtoMessage
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