#[non_exhaustive]pub struct SearchEventsOptionalParams {
pub body: Option<EventsListRequest>,
}
Expand description
SearchEventsOptionalParams is a struct for passing parameters to the method EventsAPI::search_events
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.body: Option<EventsListRequest>
Implementations§
Source§impl SearchEventsOptionalParams
impl SearchEventsOptionalParams
Sourcepub fn body(self, value: EventsListRequest) -> Self
pub fn body(self, value: EventsListRequest) -> Self
Examples found in repository?
examples/v2_events_SearchEvents.rs (line 24)
11async fn main() {
12 let body = EventsListRequest::new()
13 .filter(
14 EventsQueryFilter::new()
15 .from("2020-09-17T11:48:36+01:00".to_string())
16 .query("datadog-agent".to_string())
17 .to("2020-09-17T12:48:36+01:00".to_string()),
18 )
19 .page(EventsRequestPage::new().limit(5))
20 .sort(EventsSort::TIMESTAMP_ASCENDING);
21 let configuration = datadog::Configuration::new();
22 let api = EventsAPI::with_config(configuration);
23 let resp = api
24 .search_events(SearchEventsOptionalParams::default().body(body))
25 .await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
More examples
examples/v2_events_SearchEvents_3856995058.rs (line 27)
14async fn main() {
15 let body = EventsListRequest::new()
16 .filter(
17 EventsQueryFilter::new()
18 .from("now-15m".to_string())
19 .to("now".to_string()),
20 )
21 .options(EventsQueryOptions::new().timezone("GMT".to_string()))
22 .page(EventsRequestPage::new().limit(2))
23 .sort(EventsSort::TIMESTAMP_ASCENDING);
24 let configuration = datadog::Configuration::new();
25 let api = EventsAPI::with_config(configuration);
26 let response =
27 api.search_events_with_pagination(SearchEventsOptionalParams::default().body(body));
28 pin_mut!(response);
29 while let Some(resp) = response.next().await {
30 if let Ok(value) = resp {
31 println!("{:#?}", value);
32 } else {
33 println!("{:#?}", resp.unwrap_err());
34 }
35 }
36}
Trait Implementations§
Source§impl Clone for SearchEventsOptionalParams
impl Clone for SearchEventsOptionalParams
Source§fn clone(&self) -> SearchEventsOptionalParams
fn clone(&self) -> SearchEventsOptionalParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SearchEventsOptionalParams
impl Debug for SearchEventsOptionalParams
Source§impl Default for SearchEventsOptionalParams
impl Default for SearchEventsOptionalParams
Source§fn default() -> SearchEventsOptionalParams
fn default() -> SearchEventsOptionalParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SearchEventsOptionalParams
impl RefUnwindSafe for SearchEventsOptionalParams
impl Send for SearchEventsOptionalParams
impl Sync for SearchEventsOptionalParams
impl Unpin for SearchEventsOptionalParams
impl UnwindSafe for SearchEventsOptionalParams
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
Mutably borrows from an owned value. Read more