#[non_exhaustive]pub struct AuditQuery {
pub on_behalf_of: PrincipalId,
pub since: Option<i64>,
pub method_prefix: Option<String>,
pub cursor: Option<AuditCursor>,
pub limit: usize,
}Expand description
One page request against the audit table.
Build with new (which enforces the user-principal
invariant) and narrow with the with_* combinators. Every filter is
conjunctive.
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.on_behalf_of: PrincipalIdThe human the rows must be attributable to — matched against
record.sub. Always a PrincipalKind::User.
since: Option<i64>Inclusive lower bound on record.at (kamaji’s clock), when set.
method_prefix: Option<String>Literal prefix record.method must start with, when set. Not a glob
and not a regex — W127’s “who deployed what” needs cloud.deploy,
nothing richer.
cursor: Option<AuditCursor>Resume position from a previous page’s next_cursor.
limit: usizePage size, already clamped to 1..=MAX_AUDIT_PAGE_LIMIT.
Implementations§
Source§impl AuditQuery
impl AuditQuery
Sourcepub fn new(on_behalf_of: PrincipalId) -> Result<Self, AuditQueryError>
pub fn new(on_behalf_of: PrincipalId) -> Result<Self, AuditQueryError>
New query for on_behalf_of, at the default page size.
Rejects a non-user principal — see
AuditQueryError::OnBehalfOfNotUser.
pub fn with_since(self, since: i64) -> Self
pub fn with_method_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_cursor(self, cursor: AuditCursor) -> Self
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set the page size, clamped to 1..=MAX_AUDIT_PAGE_LIMIT. Clamps
rather than erroring: an over-large ?limit= is a client that wants
“as much as you’ll give me”, and failing the whole request over it
buys nothing.