pub struct SqliteEnvelopeStack { /* private fields */ }
Expand description
An EnvelopeStack
that is implemented on an SQLite database.
For efficiency reasons, the implementation has an in-memory buffer that is periodically spooled to disk in a batched way.
Implementations§
source§impl SqliteEnvelopeStack
impl SqliteEnvelopeStack
sourcepub fn new(
partition_id: u8,
envelope_store: SqliteEnvelopeStore,
batch_size_bytes: usize,
own_key: ProjectKey,
sampling_key: ProjectKey,
check_disk: bool,
) -> Self
pub fn new( partition_id: u8, envelope_store: SqliteEnvelopeStore, batch_size_bytes: usize, own_key: ProjectKey, sampling_key: ProjectKey, check_disk: bool, ) -> Self
Creates a new empty SqliteEnvelopeStack
.
Trait Implementations§
source§impl Debug for SqliteEnvelopeStack
impl Debug for SqliteEnvelopeStack
source§impl EnvelopeStack for SqliteEnvelopeStack
impl EnvelopeStack for SqliteEnvelopeStack
source§type Error = SqliteEnvelopeStackError
type Error = SqliteEnvelopeStackError
The error type that is returned when an error is encountered during reading or writing the
EnvelopeStack
.source§async fn push(&mut self, envelope: Box<Envelope>) -> Result<(), Self::Error>
async fn push(&mut self, envelope: Box<Envelope>) -> Result<(), Self::Error>
Pushes an [
Envelope
] on top of the stack.source§async fn peek(&mut self) -> Result<Option<DateTime<Utc>>, Self::Error>
async fn peek(&mut self) -> Result<Option<DateTime<Utc>>, Self::Error>
Peeks the [
Envelope
] on top of the stack.source§async fn pop(&mut self) -> Result<Option<Box<Envelope>>, Self::Error>
async fn pop(&mut self) -> Result<Option<Box<Envelope>>, Self::Error>
Pops the [
Envelope
] on top of the stack.source§async fn flush(self)
async fn flush(self)
Persists all envelopes in the
EnvelopeStack
s to external storage, if possible,
and consumes the stack provider.Auto Trait Implementations§
impl Freeze for SqliteEnvelopeStack
impl !RefUnwindSafe for SqliteEnvelopeStack
impl Send for SqliteEnvelopeStack
impl Sync for SqliteEnvelopeStack
impl Unpin for SqliteEnvelopeStack
impl !UnwindSafe for SqliteEnvelopeStack
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
§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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request