pub enum RequestBody {
CONNECT {
protocol_version: u8,
pub_key: [u8; 32],
},
CREATE(SlotRange),
PUT {
slots: SlotBody,
},
APPEND {
items: Vec<Vec<u8>>,
},
WIPE(SlotRange),
REQUEST(SlotRange),
SUBSCRIBE(SlotRange),
UNSUBSCRIBE,
}
Expand description
The body of a request packet
§Variants
CONNECT
- connect to a serverCREATE
- create a new bucketPUT
- put one or multiple items in a bucketAPPEND
- append one or multiple items to a bucketWIPE
- wipe or delete a bucketREQUEST
- request one or multiple items from a bucketSUBSCRIBE
- subscribe to a bucketUNSUBSCRIBE
- unsubscribe from a bucket
Variants§
CONNECT
CREATE(SlotRange)
PUT
APPEND
WIPE(SlotRange)
REQUEST(SlotRange)
SUBSCRIBE(SlotRange)
UNSUBSCRIBE
Trait Implementations§
Source§impl Debug for RequestBody
impl Debug for RequestBody
Source§impl PtpBody for RequestBody
impl PtpBody for RequestBody
Source§fn packet_type(&self) -> u8
fn packet_type(&self) -> u8
Get packet type byte
Source§impl PtpPacket<RequestHeader, RequestBody> for RequestPacket
impl PtpPacket<RequestHeader, RequestBody> for RequestPacket
Source§fn get_header(&self) -> &RequestHeader
fn get_header(&self) -> &RequestHeader
Returns the header of the packet
Source§fn get_body(&self) -> &RequestBody
fn get_body(&self) -> &RequestBody
Returns the body of the packet
Source§fn new(header: RequestHeader, body: RequestBody, mac: Option<[u8; 16]>) -> Self
fn new(header: RequestHeader, body: RequestBody, 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 RequestBody
impl Serializable for RequestBody
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 RequestBody
impl RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl UnwindSafe for RequestBody
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