pub struct Archive {
pub location: String,
pub provider: &'static str,
pub flush_every: Duration,
pub retention_days: u32,
/* private fields */
}Fields§
§location: StringThe bucket URL without credentials, for display.
provider: &'static str§flush_every: Duration§retention_days: u32Days to keep; 0 keeps everything.
Implementations§
Source§impl Archive
impl Archive
Sourcepub fn open(url: &str) -> Result<Self>
pub fn open(url: &str) -> Result<Self>
Opens s3://bucket/prefix, gs://bucket/prefix, file:///path or memory://.
S3 and GCS read credentials from the standard environment variables; for R2 or MinIO
set AWS_ENDPOINT (and AWS_ALLOW_HTTP=true for a plain-HTTP endpoint).
pub fn with_store( store: Arc<dyn ObjectStore>, prefix: &str, location: String, provider: &'static str, ) -> Self
pub fn status(&self) -> Status
Sourcepub async fn write_chunk(&self, records: &[LogRecord]) -> Result<()>
pub async fn write_chunk(&self, records: &[LogRecord]) -> Result<()>
Writes one chunk and moves the checkpoint forward. records must not be empty.
Sourcepub async fn checkpoint(&self) -> Result<Option<SystemTime>>
pub async fn checkpoint(&self) -> Result<Option<SystemTime>>
The newest archived line’s time, if anything has been archived.
Sourcepub async fn query(
&self,
filter: &Filter,
limit: usize,
) -> Result<Vec<LogRecord>>
pub async fn query( &self, filter: &Filter, limit: usize, ) -> Result<Vec<LogRecord>>
The newest limit archived lines matching filter, oldest first.
Sourcepub async fn sweep(&self, keep_days: u32, now: SystemTime) -> Result<u64>
pub async fn sweep(&self, keep_days: u32, now: SystemTime) -> Result<u64>
Deletes whole days older than keep_days before now. Returns the objects removed.
pub async fn stats(&self) -> Result<Stats>
Auto Trait Implementations§
impl !Freeze for Archive
impl !RefUnwindSafe for Archive
impl !UnwindSafe for Archive
impl Send for Archive
impl Sync for Archive
impl Unpin for Archive
impl UnsafeUnpin for Archive
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more