pub struct PipelineResponse {
pub status: u16,
pub body: Vec<u8>,
pub content_type: Option<String>,
}Expand description
The response the pipeline produces for a handled request.
A status plus a JSON body, mirroring the relevant fields of an OpenSearch response so the transport can relay it to the client unchanged.
Fields§
§status: u16The HTTP status to return to the client.
body: Vec<u8>The JSON response body.
content_type: Option<String>The response content type. None ⇒ application/json: every response the
proxy shapes is JSON, so that is the default. It is set only on the
verbatim admin/cursor passthrough, where the upstream may answer with a
non-JSON type (e.g. _cat returns text/plain); forcing application/json
there would mislabel the body (docs/03 §6).
Implementations§
Source§impl PipelineResponse
impl PipelineResponse
Sourcepub fn json(status: u16, body: Vec<u8>) -> Self
pub fn json(status: u16, body: Vec<u8>) -> Self
A JSON response, the shape every tenancy-aware endpoint returns.
Sourcepub fn with_content_type(self, content_type: Option<String>) -> Self
pub fn with_content_type(self, content_type: Option<String>) -> Self
Carries the upstream content type verbatim (the admin/cursor passthrough),
so a non-JSON upstream body is not mislabeled application/json.
Trait Implementations§
Source§impl Clone for PipelineResponse
impl Clone for PipelineResponse
Source§fn clone(&self) -> PipelineResponse
fn clone(&self) -> PipelineResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PipelineResponse
impl Debug for PipelineResponse
impl Eq for PipelineResponse
Source§impl PartialEq for PipelineResponse
impl PartialEq for PipelineResponse
Source§fn eq(&self, other: &PipelineResponse) -> bool
fn eq(&self, other: &PipelineResponse) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PipelineResponse
Auto Trait Implementations§
impl Freeze for PipelineResponse
impl RefUnwindSafe for PipelineResponse
impl Send for PipelineResponse
impl Sync for PipelineResponse
impl Unpin for PipelineResponse
impl UnsafeUnpin for PipelineResponse
impl UnwindSafe for PipelineResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.