pub struct LogsApi<'a> { /* private fields */ }Expand description
Logs API façade.
Implementations§
Source§impl<'a> LogsApi<'a>
impl<'a> LogsApi<'a>
Sourcepub fn new(client: &'a DatadogClient) -> Self
pub fn new(client: &'a DatadogClient) -> Self
Wraps an existing DatadogClient for log operations.
Sourcepub async fn search(
&self,
query: &str,
from: &str,
to: &str,
limit: usize,
sort: SortOrder,
after: Option<&str>,
) -> Result<LogSearchResult>
pub async fn search( &self, query: &str, from: &str, to: &str, limit: usize, sort: SortOrder, after: Option<&str>, ) -> Result<LogSearchResult>
Searches log events.
from and to are passed through to Datadog as strings. Datadog
accepts ISO 8601 timestamps, epoch milliseconds, and relative
shorthand like now-15m / now; callers are expected to convert
CLI-level inputs into a form Datadog understands before calling.
Returns a single page only. When after is Some, Datadog
resumes pagination at that cursor token (page.cursor in the
request body). The next-page token is preserved on
meta.page.after of the response so the caller (or
LogsApi::search_all) can iterate.
limit is rejected client-side when it exceeds MAX_PAGE_LIMIT.
Sourcepub async fn search_all(
&self,
query: &str,
from: &str,
to: &str,
limit: usize,
sort: SortOrder,
) -> Result<LogSearchResult>
pub async fn search_all( &self, query: &str, from: &str, to: &str, limit: usize, sort: SortOrder, ) -> Result<LogSearchResult>
Searches log 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 block 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 LogsApi<'a>
impl<'a> !RefUnwindSafe for LogsApi<'a>
impl<'a> Send for LogsApi<'a>
impl<'a> Sync for LogsApi<'a>
impl<'a> Unpin for LogsApi<'a>
impl<'a> UnsafeUnpin for LogsApi<'a>
impl<'a> !UnwindSafe for LogsApi<'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