Struct RetainedBucketWindow
pub struct RetainedBucketWindow { /* private fields */ }Available on crate features
std and ua only.Expand description
One authorization/profile/flow/structural scope, with no duplicate day coverage.
Implementations§
§impl RetainedBucketWindow
impl RetainedBucketWindow
pub fn new( domain: CanonicalDomain, scope: ValueId, seed: [u8; 32], limits: ProfileWindowLimits, ) -> Result<RetainedBucketWindow, ProfileDataError>
pub fn observe(
&mut self,
current_day: u32,
observation_day: u32,
observation: ObservationId,
value: &CanonicalValue,
) -> Result<(), ProfileDataError>
pub fn observe( &mut self, current_day: u32, observation_day: u32, observation: ObservationId, value: &CanonicalValue, ) -> Result<(), ProfileDataError>
The enclosing transaction must admit this observation ID exactly once. Day and byte-budget checks complete before counts or retention change.
pub fn advance(&mut self, current_day: u32) -> Result<(), ProfileDataError>
pub fn advance(&mut self, current_day: u32) -> Result<(), ProfileDataError>
Remove expired state even when no new observations arrive.
The day comes from the receiver clock via profile_utc_day, never peer metadata.
pub fn select(
&self,
current_day: u32,
horizon: u32,
) -> Result<CountedObservationBucket, ProfileDataError>
pub fn select( &self, current_day: u32, horizon: u32, ) -> Result<CountedObservationBucket, ProfileDataError>
The current partial UTC day counts toward the requested horizon. Expired counts and samples cannot influence the result.
pub fn retained_bytes(&self) -> usize
pub fn snapshot(&self) -> RetainedBucketsSnapshot
pub fn from_snapshot( snapshot: &RetainedBucketsSnapshot, expected_domain: CanonicalDomain, expected_scope: ValueId, seed: [u8; 32], limits: ProfileWindowLimits, ) -> Result<RetainedBucketWindow, ProfileDataError>
Trait Implementations§
§impl Clone for RetainedBucketWindow
impl Clone for RetainedBucketWindow
§fn clone(&self) -> RetainedBucketWindow
fn clone(&self) -> RetainedBucketWindow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RetainedBucketWindow
impl RefUnwindSafe for RetainedBucketWindow
impl Send for RetainedBucketWindow
impl Sync for RetainedBucketWindow
impl Unpin for RetainedBucketWindow
impl UnsafeUnpin for RetainedBucketWindow
impl UnwindSafe for RetainedBucketWindow
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more