#[non_exhaustive]pub struct LogEntry {
pub name: String,
pub timestamp: Option<Timestamp>,
pub severity: LogSeverity,
pub http_request: Option<HttpRequest>,
pub trace: String,
pub insert_id: String,
pub labels: HashMap<String, String>,
pub operation: Option<LogEntryOperation>,
pub source_location: Option<LogEntrySourceLocation>,
pub payload: Option<Payload>,
/* private fields */
}Expand description
An individual log entry.
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.name: StringRequired. The log to which this log entry belongs. Examples: "syslog",
"book_log".
timestamp: Option<Timestamp>The time the event described by the log entry occurred. If omitted, defaults to operation start time.
severity: LogSeverityThe severity of the log entry. The default value is
LogSeverity.DEFAULT.
http_request: Option<HttpRequest>Optional. Information about the HTTP request associated with this log entry, if applicable.
trace: StringOptional. Resource name of the trace associated with the log entry, if any.
If this field contains a relative resource name, you can assume the name is
relative to //tracing.googleapis.com. Example:
projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
insert_id: StringA unique ID for the log entry used for deduplication. If omitted, the implementation will generate one based on operation_id.
labels: HashMap<String, String>A set of user-defined (key, value) data that provides additional information about the log entry.
operation: Option<LogEntryOperation>Optional. Information about an operation associated with the log entry, if applicable.
source_location: Option<LogEntrySourceLocation>Optional. Source code location information associated with the log entry, if any.
payload: Option<Payload>The log entry payload, which can be one of multiple types.
Implementations§
Source§impl LogEntry
impl LogEntry
pub fn new() -> Self
Sourcepub fn set_timestamp<T>(self, v: T) -> Self
pub fn set_timestamp<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_timestamp<T>(self, v: Option<T>) -> Self
Sourcepub fn set_severity<T: Into<LogSeverity>>(self, v: T) -> Self
pub fn set_severity<T: Into<LogSeverity>>(self, v: T) -> Self
Sourcepub fn set_http_request<T>(self, v: T) -> Selfwhere
T: Into<HttpRequest>,
pub fn set_http_request<T>(self, v: T) -> Selfwhere
T: Into<HttpRequest>,
Sets the value of http_request.
§Example
use google_cloud_api_servicecontrol_v1::model::HttpRequest;
let x = LogEntry::new().set_http_request(HttpRequest::default()/* use setters */);Sourcepub fn set_or_clear_http_request<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpRequest>,
pub fn set_or_clear_http_request<T>(self, v: Option<T>) -> Selfwhere
T: Into<HttpRequest>,
Sets or clears the value of http_request.
§Example
use google_cloud_api_servicecontrol_v1::model::HttpRequest;
let x = LogEntry::new().set_or_clear_http_request(Some(HttpRequest::default()/* use setters */));
let x = LogEntry::new().set_or_clear_http_request(None::<HttpRequest>);Sourcepub fn set_insert_id<T: Into<String>>(self, v: T) -> Self
pub fn set_insert_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_operation<T>(self, v: T) -> Selfwhere
T: Into<LogEntryOperation>,
pub fn set_operation<T>(self, v: T) -> Selfwhere
T: Into<LogEntryOperation>,
Sourcepub fn set_or_clear_operation<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntryOperation>,
pub fn set_or_clear_operation<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntryOperation>,
Sourcepub fn set_source_location<T>(self, v: T) -> Selfwhere
T: Into<LogEntrySourceLocation>,
pub fn set_source_location<T>(self, v: T) -> Selfwhere
T: Into<LogEntrySourceLocation>,
Sets the value of source_location.
§Example
use google_cloud_api_servicecontrol_v1::model::LogEntrySourceLocation;
let x = LogEntry::new().set_source_location(LogEntrySourceLocation::default()/* use setters */);Sourcepub fn set_or_clear_source_location<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntrySourceLocation>,
pub fn set_or_clear_source_location<T>(self, v: Option<T>) -> Selfwhere
T: Into<LogEntrySourceLocation>,
Sets or clears the value of source_location.
§Example
use google_cloud_api_servicecontrol_v1::model::LogEntrySourceLocation;
let x = LogEntry::new().set_or_clear_source_location(Some(LogEntrySourceLocation::default()/* use setters */));
let x = LogEntry::new().set_or_clear_source_location(None::<LogEntrySourceLocation>);Sourcepub fn set_payload<T: Into<Option<Payload>>>(self, v: T) -> Self
pub fn set_payload<T: Into<Option<Payload>>>(self, v: T) -> Self
Sourcepub fn proto_payload(&self) -> Option<&Box<Any>>
pub fn proto_payload(&self) -> Option<&Box<Any>>
The value of payload
if it holds a ProtoPayload, None if the field is not set or
holds a different branch.
Sourcepub fn set_proto_payload<T: Into<Box<Any>>>(self, v: T) -> Self
pub fn set_proto_payload<T: Into<Box<Any>>>(self, v: T) -> Self
Sets the value of payload
to hold a ProtoPayload.
Note that all the setters affecting payload are
mutually exclusive.
§Example
use wkt::Any;
let x = LogEntry::new().set_proto_payload(Any::default()/* use setters */);
assert!(x.proto_payload().is_some());
assert!(x.text_payload().is_none());
assert!(x.struct_payload().is_none());Sourcepub fn text_payload(&self) -> Option<&String>
pub fn text_payload(&self) -> Option<&String>
The value of payload
if it holds a TextPayload, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_payload<T: Into<String>>(self, v: T) -> Self
pub fn set_text_payload<T: Into<String>>(self, v: T) -> Self
Sourcepub fn struct_payload(&self) -> Option<&Box<Struct>>
pub fn struct_payload(&self) -> Option<&Box<Struct>>
The value of payload
if it holds a StructPayload, None if the field is not set or
holds a different branch.
Sourcepub fn set_struct_payload<T: Into<Box<Struct>>>(self, v: T) -> Self
pub fn set_struct_payload<T: Into<Box<Struct>>>(self, v: T) -> Self
Sets the value of payload
to hold a StructPayload.
Note that all the setters affecting payload are
mutually exclusive.
§Example
use wkt::Struct;
let x = LogEntry::new().set_struct_payload(Struct::default()/* use setters */);
assert!(x.struct_payload().is_some());
assert!(x.proto_payload().is_none());
assert!(x.text_payload().is_none());