pub struct Request {
pub config: Config,
pub client_info: ClientInfo,
pub handles: Handles,
pub operation: Operation,
}Expand description
Represents a request to the Volcengine API.
This struct holds all the necessary components for making a request to the Volcengine API. It contains the configuration, client information, operation details, and handles to manage the request operations. The struct is designed to encapsulate the various elements required for interacting with the Volcengine service, ensuring that all necessary data is included when making the API request.
Fields§
§config: ConfigConfiguration settings for the request.
This field contains the configuration settings necessary to make the request. It might include things like authentication details, API keys, endpoint URLs, or other settings related to the request environment.
client_info: ClientInfoInformation about the client making the request.
This field contains details about the client or the system that is making the request. This could include information such as the client ID, version, operating system, and any other metadata relevant to identifying the client.
handles: HandlesHandles for managing request operations.
This field provides handles to manage the lifecycle and execution of the request. These could include handles for making retries, timeouts, managing API rate limits, or other request-related operations.
operation: OperationOperation details for the request.
This field holds the specific operation that the request will perform. It might include data like the action or API method being called, parameters for that action, or other relevant details for the request’s operation.
Implementations§
Source§impl Request
Implementation of the Request struct, providing methods to construct and manage a request.
impl Request
Implementation of the Request struct, providing methods to construct and manage a request.
This block of code defines methods associated with the Request struct, such as the builder method.
The Request struct represents an API request to the Volcengine API and is composed of various components
including the configuration, client information, handles, and operation. The methods in this impl block
allow for the creation and management of these components, making it easier to construct and send requests.
The builder pattern is used here, allowing you to step-by-step configure the components of the Request
before it is finalized and sent. This is especially useful for building requests with varying components.
§Example Usage
let request = Request::builder()
.config(config)
.client_info(client_info)
.handles(handles)
.operation(operation)
.build();Sourcepub fn builder() -> RequestBuilder
pub fn builder() -> RequestBuilder
Constructs a new RequestBuilder instance for building a Request.
This method provides a fluent interface for constructing a Request step by step. It allows
for setting the configuration, client information, handles, and operation before finalizing
and creating the actual Request object. This is useful when you need to build a request
with optional components that may vary between requests.
§Returns
Returns a RequestBuilder that enables the construction of a Request object. The builder
can be used to set each of the fields in the Request struct, allowing for customization
of the request before it is finalized.
§Example
let request = Request::builder()
.config(config)
.client_info(client_info)
.handles(handles)
.operation(operation)
.build();Trait Implementations§
Source§impl RequestVolcengine for Request
Implementation of the RequestVolcengine trait for the Request struct.
impl RequestVolcengine for Request
Implementation of the RequestVolcengine trait for the Request struct.
This block provides methods for formatting the request into a HashMap and sending an API request.
The methods implement the functionality needed to interact with the Volcengine API. The Request struct
is adapted to handle serialization and request sending according to the Volcengine API’s requirements.
The methods in this implementation allow for easy conversion of the request data to a format expected
by the Volcengine API and also provide a way to send the request over HTTP using the reqwest library.
§Example Usage
let request = Request::builder()
.config(config)
.client_info(client_info)
.handles(handles)
.operation(operation)
.build();
let result = request.send(api_request);Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request