pub struct TextBackend { /* private fields */ }Expand description
A cache backend backed by a plain text file.
Supports line-oriented operations: read ranges, grep, head, tail, stats. The file is written once at creation and read on each operation.
Implementations§
Source§impl TextBackend
impl TextBackend
Trait Implementations§
Source§impl CacheBackend for TextBackend
impl CacheBackend for TextBackend
Source§fn kind(&self) -> BackendKind
fn kind(&self) -> BackendKind
What kind of backend this is.
Source§fn execute(&self, op: CacheOp) -> Result<String, CacheError>
fn execute(&self, op: CacheOp) -> Result<String, CacheError>
Execute an operation on the cached data.
Source§fn stats(&self) -> Result<CacheStats, CacheError>
fn stats(&self) -> Result<CacheStats, CacheError>
Statistics about the cached data.
Source§fn preview(&self, max_lines: usize) -> Result<String, CacheError>
fn preview(&self, max_lines: usize) -> Result<String, CacheError>
A short preview of the data (first N lines/rows).
Source§fn disk_bytes(&self) -> Result<u64, CacheError>
fn disk_bytes(&self) -> Result<u64, CacheError>
Size on disk in bytes.
Auto Trait Implementations§
impl Freeze for TextBackend
impl RefUnwindSafe for TextBackend
impl Send for TextBackend
impl Sync for TextBackend
impl Unpin for TextBackend
impl UnsafeUnpin for TextBackend
impl UnwindSafe for TextBackend
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