pub struct JsonlStore { /* private fields */ }Expand description
Append-only JSON-lines store. All events go to a single events.jsonl;
replay filters by stream key. Simple and debuggable for the first stab; rotation
and per-agent sharding are deferred.
Implementations§
Trait Implementations§
Source§impl Store for JsonlStore
impl Store for JsonlStore
Source§fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 FleetEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 FleetEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append one event to durable storage.
Source§fn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
from_seq: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<FleetEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
from_seq: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<FleetEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replay events for one stream with
seq >= from_seq, in seq order.Source§fn high_water<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn high_water<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The highest
seq ever persisted for stream_key (0 if none). Used to
resume that stream’s sequence counter across daemon restarts.Source§fn writable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn writable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Whether the backend can currently accept writes. A cheap, non-destructive
probe used by the readiness endpoint.
Source§fn prune<'life0, 'life1, 'async_trait>(
&'life0 self,
before_ts: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prune<'life0, 'life1, 'async_trait>(
&'life0 self,
before_ts: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete events with
ts < before_ts (RFC-3339, lexically ordered).
Returns the number removed. Backs age-based retention (#4).Source§fn usage<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
since: &'life1 str,
until: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<UsageRow>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn usage<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
since: &'life1 str,
until: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<UsageRow>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Aggregate cost, turns, and terminal outcomes per (workspace, UTC day)
over
[since, until) (RFC-3339, lexically ordered like Store::prune). Read moreAuto Trait Implementations§
impl !Freeze for JsonlStore
impl RefUnwindSafe for JsonlStore
impl Send for JsonlStore
impl Sync for JsonlStore
impl Unpin for JsonlStore
impl UnsafeUnpin for JsonlStore
impl UnwindSafe for JsonlStore
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> 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