pub struct GoogleApiHttpBody {
pub data: Option<Vec<u8>>,
pub extensions: Option<Vec<HashMap<String, Value>>>,
pub content_type: Option<String>,
}Expand description
Message that represents an arbitrary HTTP body. It should only be used for payload formats that can’t be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.
§Activities
This type is used in activities, which are methods you may call on this type or where this type is involved in. The list links the activity name, along with information about where it is used (one of request and response).
Fields§
§data: Option<Vec<u8>>The HTTP request/response body as raw binary.
extensions: Option<Vec<HashMap<String, Value>>>Application specific response metadata. Must be set in the first response for streaming APIs.
content_type: Option<String>The HTTP Content-Type header value specifying the content type of the body.
Trait Implementations§
Source§impl Clone for GoogleApiHttpBody
impl Clone for GoogleApiHttpBody
Source§fn clone(&self) -> GoogleApiHttpBody
fn clone(&self) -> GoogleApiHttpBody
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GoogleApiHttpBody
impl Debug for GoogleApiHttpBody
Source§impl Default for GoogleApiHttpBody
impl Default for GoogleApiHttpBody
Source§fn default() -> GoogleApiHttpBody
fn default() -> GoogleApiHttpBody
Source§impl<'de> Deserialize<'de> for GoogleApiHttpBody
impl<'de> Deserialize<'de> for GoogleApiHttpBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for GoogleApiHttpBody
impl Serialize for GoogleApiHttpBody
impl ResponseResult for GoogleApiHttpBody
Auto Trait Implementations§
impl Freeze for GoogleApiHttpBody
impl RefUnwindSafe for GoogleApiHttpBody
impl Send for GoogleApiHttpBody
impl Sync for GoogleApiHttpBody
impl Unpin for GoogleApiHttpBody
impl UnwindSafe for GoogleApiHttpBody
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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