Struct FsReplayStore
pub struct FsReplayStore { /* private fields */ }http and std only.Expand description
Capture small uploads in memory and spill larger uploads into temporary files.
Per-request limits count payload bytes. Clones share a disk budget for all file payloads, including memory prefixes migrated to disk, and at most 64 live files. A request can use the full limit. A reservation that would exceed a limit immediately disables replay for that request.
After spilling, writes smaller than the lesser of the memory threshold and 16 KiB can be batched in memory. Disk quota is reserved before submitting each frame. A retry flushes all pending writes before it can open a reader. If the first attempt is final, the buffer is discarded and any write already submitted to the filesystem settles before its quota is returned.
The backing file is anonymous on Unix and delete-on-close on Windows. Readers and outstanding blocking I/O retain both the file and its quota. Dropping the last owner closes the descriptor before releasing its charge.
Implementations§
§impl FsReplayStore
impl FsReplayStore
pub async fn in_dir(parent: impl AsRef<Path>) -> Result<FsReplayStore, Error>
pub async fn in_dir(parent: impl AsRef<Path>) -> Result<FsReplayStore, Error>
Create a store under an existing parent with a 64 KiB memory threshold,
an 8 MiB limit per upload, and a shared 512 MiB disk budget. The capture
timeout defaults to 30 seconds. Use Self::new for custom limits.
pub async fn new(
parent: impl AsRef<Path>,
memory_threshold: usize,
max_body_bytes: usize,
max_disk_bytes: u64,
) -> Result<FsReplayStore, Error>
pub async fn new( parent: impl AsRef<Path>, memory_threshold: usize, max_body_bytes: usize, max_disk_bytes: u64, ) -> Result<FsReplayStore, Error>
Create a private per-store directory under the existing trusted parent. A body stays in memory through the inclusive memory threshold and can replay through the inclusive per-body maximum. Zero threshold spills every nonempty body; zero disk budget permits only memory captures.
pub fn with_timeout(self, timeout: Duration) -> FsReplayStore
pub fn with_timeout(self, timeout: Duration) -> FsReplayStore
Set the capture deadline for requests using this handle.
pub fn set_timeout(&mut self, timeout: Duration) -> &mut FsReplayStore
pub fn set_timeout(&mut self, timeout: Duration) -> &mut FsReplayStore
Set the capture deadline for requests using this handle.
Trait Implementations§
§impl Clone for FsReplayStore
impl Clone for FsReplayStore
§fn clone(&self) -> FsReplayStore
fn clone(&self) -> FsReplayStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for FsReplayStore
impl Debug for FsReplayStore
§impl ReplayStore for FsReplayStore
impl ReplayStore for FsReplayStore
§fn start(&self) -> Box<dyn ReplayWriter>
fn start(&self) -> Box<dyn ReplayWriter>
§fn max_bytes(&self) -> u64
fn max_bytes(&self) -> u64
§fn timeout(&self) -> Duration
fn timeout(&self) -> Duration
§fn reuse_buffered_bytes(&self) -> bool
fn reuse_buffered_bytes(&self) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for FsReplayStore
impl !UnwindSafe for FsReplayStore
impl Forget for FsReplayStore
impl Freeze for FsReplayStore
impl Move for FsReplayStore
impl Send for FsReplayStore
impl Sync for FsReplayStore
impl Unpin for FsReplayStore
impl UnsafeUnpin for FsReplayStore
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
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> ⓘ
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> ⓘ
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>
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>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more