pub enum RequestPacket {
Single(SerializedRequest),
Batch(Vec<SerializedRequest>),
}
Expand description
A RequestPacket
is a SerializedRequest
or a batch of serialized
request.
Variants§
Implementations§
source§impl RequestPacket
impl RequestPacket
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new empty packet with the given capacity.
sourcepub fn subscription_request_ids(&self) -> HashSet<&Id>
pub fn subscription_request_ids(&self) -> HashSet<&Id>
Get the request IDs of all subscription requests in the packet.
sourcepub fn push(&mut self, req: SerializedRequest)
pub fn push(&mut self, req: SerializedRequest)
Push a request into the packet.
Trait Implementations§
source§impl Clone for RequestPacket
impl Clone for RequestPacket
source§fn clone(&self) -> RequestPacket
fn clone(&self) -> RequestPacket
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RequestPacket
impl Debug for RequestPacket
source§impl From<SerializedRequest> for RequestPacket
impl From<SerializedRequest> for RequestPacket
source§fn from(req: SerializedRequest) -> Self
fn from(req: SerializedRequest) -> Self
Converts to this type from the input type.
source§impl FromIterator<SerializedRequest> for RequestPacket
impl FromIterator<SerializedRequest> for RequestPacket
source§fn from_iter<T: IntoIterator<Item = SerializedRequest>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = SerializedRequest>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for RequestPacket
impl RefUnwindSafe for RequestPacket
impl Send for RequestPacket
impl Sync for RequestPacket
impl Unpin for RequestPacket
impl UnwindSafe for RequestPacket
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)