#[non_exhaustive]pub struct Api {
pub service: String,
pub operation: String,
pub protocol: String,
pub version: String,
/* private fields */
}Expand description
This message defines attributes associated with API operations, such as a network API request. The terminology is based on the conventions used by Google APIs, Istio, and OpenAPI.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.service: StringThe API service name. It is a logical identifier for a networked API, such as “pubsub.googleapis.com”. The naming syntax depends on the API management system being used for handling the request.
operation: StringThe API operation name. For gRPC requests, it is the fully qualified API
method name, such as “google.pubsub.v1.Publisher.Publish”. For OpenAPI
requests, it is the operationId, such as “getPet”.
protocol: StringThe API protocol used for sending the request, such as “http”, “https”, “grpc”, or “internal”.
version: StringThe API version associated with the API operation above, such as “v1” or “v1alpha1”.
Implementations§
Source§impl Api
impl Api
pub fn new() -> Self
Sourcepub fn set_service<T: Into<String>>(self, v: T) -> Self
pub fn set_service<T: Into<String>>(self, v: T) -> Self
Sets the value of service.
Sourcepub fn set_operation<T: Into<String>>(self, v: T) -> Self
pub fn set_operation<T: Into<String>>(self, v: T) -> Self
Sets the value of operation.
Sourcepub fn set_protocol<T: Into<String>>(self, v: T) -> Self
pub fn set_protocol<T: Into<String>>(self, v: T) -> Self
Sets the value of protocol.
Sourcepub fn set_version<T: Into<String>>(self, v: T) -> Self
pub fn set_version<T: Into<String>>(self, v: T) -> Self
Sets the value of version.