pub enum ResponseBody {
CONNECT {
pub_key: [u8; 32],
signature: [u8; 64],
certificates: Vec<Certificate>,
},
CREATE,
PUT,
APPEND,
WIPE,
REQUEST {
slots: SlotBody,
},
SUBSCRIBE {
slots: Option<SlotBody>,
},
UNSUBSCRIBE,
ERROR(u8, String),
}
Expand description
The body of a response packet
§Variants
CONNECT
- the response to a connect requestCREATE
- the response to a create requestPUT
- the response to a put requestAPPEND
- the response to an append requestWIPE
- the response to a wipe requestREQUEST
- the response to a request requestSUBSCRIBE
- the response to a subscribe requestUNSUBSCRIBE
- the response to an unsubscribe request
Variants§
Trait Implementations§
Source§impl PtpBody for ResponseBody
impl PtpBody for ResponseBody
Source§fn packet_type(&self) -> u8
fn packet_type(&self) -> u8
Get packet type byte
Source§impl PtpPacket<ResponseHeader, ResponseBody> for ResponsePacket
impl PtpPacket<ResponseHeader, ResponseBody> for ResponsePacket
Source§fn get_header(&self) -> &ResponseHeader
fn get_header(&self) -> &ResponseHeader
Returns the header of the packet
Source§fn get_body(&self) -> &ResponseBody
fn get_body(&self) -> &ResponseBody
Returns the body of the packet
Source§fn new(
header: ResponseHeader,
body: ResponseBody,
mac: Option<[u8; 16]>,
) -> Self
fn new( header: ResponseHeader, body: ResponseBody, mac: Option<[u8; 16]>, ) -> Self
Create a new packet with the given header, body and MAC
Source§fn from_bytes(
data: &[u8],
info: SerializationInfo,
) -> Result<Self, SerializationError>where
Self: Sized,
fn from_bytes(
data: &[u8],
info: SerializationInfo,
) -> Result<Self, SerializationError>where
Self: Sized,
Deserialize packet from bytes Read more
Source§fn get_bytes(
&self,
info: SerializationInfo,
with_len: bool,
) -> Result<Vec<u8>, SerializationError>
fn get_bytes( &self, info: SerializationInfo, with_len: bool, ) -> Result<Vec<u8>, SerializationError>
Serialize packet to bytes Read more
Source§impl Serializable for ResponseBody
impl Serializable for ResponseBody
Source§fn from_bytes(
data: &[u8],
info: Option<SerializationInfo>,
) -> Result<Self, SerializationError>where
Self: Sized,
fn from_bytes(
data: &[u8],
info: Option<SerializationInfo>,
) -> Result<Self, SerializationError>where
Self: Sized,
Deserializes the data from a vector of bytes. Read more
Auto Trait Implementations§
impl Freeze for ResponseBody
impl RefUnwindSafe for ResponseBody
impl Send for ResponseBody
impl Sync for ResponseBody
impl Unpin for ResponseBody
impl UnwindSafe for ResponseBody
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more