pub struct EventsApi<'a> { /* private fields */ }Expand description
Events API façade.
Implementations§
Source§impl<'a> EventsApi<'a>
impl<'a> EventsApi<'a>
Sourcepub fn new(client: &'a DatadogClient) -> Self
pub fn new(client: &'a DatadogClient) -> Self
Wraps an existing DatadogClient for events operations.
Sourcepub async fn list(
&self,
filter: &EventsListFilter,
from: &str,
to: &str,
limit: usize,
after: Option<&str>,
) -> Result<EventsResponse>
pub async fn list( &self, filter: &EventsListFilter, from: &str, to: &str, limit: usize, after: Option<&str>, ) -> Result<EventsResponse>
Lists events matching filter between from and to (RFC 3339
strings) capped at limit per page.
Single-page only. When after is Some, Datadog resumes
pagination at that cursor token (page[cursor] in the query
string). The next-page token is preserved on meta.page.after
of the response so callers (or EventsApi::list_all) can
iterate.
Sourcepub async fn list_all(
&self,
filter: &EventsListFilter,
from: &str,
to: &str,
limit: usize,
) -> Result<EventsResponse>
pub async fn list_all( &self, filter: &EventsListFilter, from: &str, to: &str, limit: usize, ) -> Result<EventsResponse>
Lists events, auto-paginating via cursor as needed.
limit == 0 means “fetch every match up to HARD_CAP”. Any
non-zero limit is upper-bounded by HARD_CAP to keep a single
invocation from issuing more than 10k items’ worth of requests.
Per-request page size is clamped to MAX_PAGE_LIMIT.
Termination follows cursor-pagination semantics: the loop stops
when the response omits meta.page.after (Datadog signals “no
more pages” only via the absent cursor — a short page on its own
is not a terminator) or when cap items have been collected.
The returned envelope keeps the meta and links blocks from the
last successful page so the response’s cursor reflects the
iterator’s final position (typically None when the API is
exhausted).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for EventsApi<'a>
impl<'a> !RefUnwindSafe for EventsApi<'a>
impl<'a> Send for EventsApi<'a>
impl<'a> Sync for EventsApi<'a>
impl<'a> Unpin for EventsApi<'a>
impl<'a> UnsafeUnpin for EventsApi<'a>
impl<'a> !UnwindSafe for EventsApi<'a>
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more