#[non_exhaustive]pub struct AttributeContext {
pub origin: Option<Peer>,
pub source: Option<Peer>,
pub destination: Option<Peer>,
pub request: Option<Request>,
pub response: Option<Response>,
pub resource: Option<Resource>,
pub api: Option<Api>,
pub extensions: Vec<Any>,
/* private fields */
}Expand description
This message defines the standard attribute vocabulary for Google APIs.
An attribute is a piece of metadata that describes an activity on a network service. For example, the size of an HTTP request, or the status code of an HTTP response.
Each attribute has a type and a name, which is logically defined as
a proto message field in AttributeContext. The field type becomes the
attribute type, and the field path becomes the attribute name. For example,
the attribute source.ip maps to field AttributeContext.source.ip.
This message definition is guaranteed not to have any wire breaking change. So you can use it directly for passing attributes across different systems.
NOTE: Different system may generate different subset of attributes. Please verify the system specification before relying on an attribute generated a system.
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.origin: Option<Peer>The origin of a network activity. In a multi hop network activity,
the origin represents the sender of the first hop. For the first hop,
the source and the origin must have the same content.
source: Option<Peer>The source of a network activity, such as starting a TCP connection. In a multi hop network activity, the source represents the sender of the last hop.
destination: Option<Peer>The destination of a network activity, such as accepting a TCP connection. In a multi hop network activity, the destination represents the receiver of the last hop.
request: Option<Request>Represents a network request, such as an HTTP request.
response: Option<Response>Represents a network response, such as an HTTP response.
resource: Option<Resource>Represents a target resource that is involved with a network activity. If multiple resources are involved with an activity, this must be the primary one.
api: Option<Api>Represents an API operation that is involved to a network activity.
extensions: Vec<Any>Supports extensions for advanced use cases, such as logs and metrics.
Implementations§
Source§impl AttributeContext
impl AttributeContext
pub fn new() -> Self
Sourcepub fn set_origin<T>(self, v: T) -> Self
pub fn set_origin<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_origin<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_origin<T>(self, v: Option<T>) -> Self
Sourcepub fn set_source<T>(self, v: T) -> Self
pub fn set_source<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_source<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_source<T>(self, v: Option<T>) -> Self
Sourcepub fn set_destination<T>(self, v: T) -> Self
pub fn set_destination<T>(self, v: T) -> Self
Sets the value of destination.
§Example
use google_cloud_rpc_context::model::attribute_context::Peer;
let x = AttributeContext::new().set_destination(Peer::default()/* use setters */);Sourcepub fn set_or_clear_destination<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_destination<T>(self, v: Option<T>) -> Self
Sets or clears the value of destination.
§Example
use google_cloud_rpc_context::model::attribute_context::Peer;
let x = AttributeContext::new().set_or_clear_destination(Some(Peer::default()/* use setters */));
let x = AttributeContext::new().set_or_clear_destination(None::<Peer>);Sourcepub fn set_request<T>(self, v: T) -> Self
pub fn set_request<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_request<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_request<T>(self, v: Option<T>) -> Self
Sourcepub fn set_response<T>(self, v: T) -> Self
pub fn set_response<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_response<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_response<T>(self, v: Option<T>) -> Self
Sourcepub fn set_resource<T>(self, v: T) -> Self
pub fn set_resource<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_resource<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_resource<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_api<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_api<T>(self, v: Option<T>) -> Self
Sourcepub fn set_extensions<T, V>(self, v: T) -> Self
pub fn set_extensions<T, V>(self, v: T) -> Self
Sets the value of extensions.
§Example
use wkt::Any;
let x = AttributeContext::new()
.set_extensions([
Any::default()/* use setters */,
Any::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for AttributeContext
impl Clone for AttributeContext
Source§fn clone(&self) -> AttributeContext
fn clone(&self) -> AttributeContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more