[−][src]Trait elasticsearch::http::request::Body
Body of an API call.
Some Elasticsearch APIs accept a body as part of the API call. Most APIs expect JSON, however, there are some APIs that expect newline-delimited JSON (NDJSON). The Body trait allows modelling different API body implementations.
Required methods
fn write(&self, bytes: &mut BytesMut) -> Result<(), Error>
Write to a buffer that will be written to the request stream
Provided methods
fn bytes(&self) -> Option<Bytes>
An existing immutable buffer that can be used to avoid having to write to another buffer that will then be written to the request stream.
If this method returns Some
, the bytes must be the same as
those that would be written by Body::write.
Implementations on Foreign Types
impl<'a, B: ?Sized> Body for &'a B where
B: Body,
[src]
B: Body,
fn bytes(&self) -> Option<Bytes>
[src]
fn write(&self, bytes: &mut BytesMut) -> Result<(), Error>
[src]
impl Body for Bytes
[src]
fn bytes(&self) -> Option<Bytes>
[src]
fn write(&self, bytes: &mut BytesMut) -> Result<(), Error>
[src]
impl Body for BytesMut
[src]
fn bytes(&self) -> Option<Bytes>
[src]
fn write(&self, bytes: &mut BytesMut) -> Result<(), Error>
[src]
impl Body for Vec<u8>
[src]
impl<'a> Body for &'a [u8]
[src]
impl Body for String
[src]
impl<'a> Body for &'a str
[src]
impl Body for ()
[src]
Loading content...
Implementors
impl Body for BulkOperations
[src]
fn bytes(&self) -> Option<Bytes>
[src]
fn write(&self, bytes: &mut BytesMut) -> Result<(), Error>
[src]
impl<B> Body for BulkOperation<B> where
B: Serialize,
[src]
B: Serialize,
impl<T> Body for JsonBody<T> where
T: Serialize,
[src]
T: Serialize,
impl<T> Body for NdBody<T> where
T: Body,
[src]
T: Body,