pub struct Body { /* private fields */ }Expand description
The body of a request a Transport sends: a sequence of byte chunks.
A JSON body is one chunk; a multipart/form-data body is its part headers and each file’s
data as is, so files are not copied to send them (D-087). Cloning is cheap (the chunks are
reference counted).
discord.js counterpart: the body of RequestInit (undici).
Implementations§
Source§impl Body
impl Body
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Returns the whole body as one buffer: the chunk itself if there is one, else a copy of them all.
Trait Implementations§
impl Eq for Body
impl StructuralPartialEq for Body
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin for Body
impl UnwindSafe for Body
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.