pub struct ErrorSnapshotter { /* private fields */ }Expand description
Captures and reloads failure-time artifacts in a crawler key-value store.
Implementations§
Source§impl ErrorSnapshotter
impl ErrorSnapshotter
Sourcepub fn new(kvs: Arc<dyn KeyValueStore>) -> Self
pub fn new(kvs: Arc<dyn KeyValueStore>) -> Self
Creates a snapshotter backed by kvs.
Sourcepub fn base_key(request: &Request) -> String
pub fn base_key(request: &Request) -> String
Returns the deterministic base storage key for request.
Sourcepub async fn capture(
&self,
request: &Request,
suffix: &str,
bytes: Bytes,
content_type: &str,
) -> StorageResult<String>
pub async fn capture( &self, request: &Request, suffix: &str, bytes: Bytes, content_type: &str, ) -> StorageResult<String>
Captures an artifact under the request base key and suffix.
Sourcepub async fn load(&self, key: &str) -> StorageResult<Option<ErrorSnapshot>>
pub async fn load(&self, key: &str) -> StorageResult<Option<ErrorSnapshot>>
Reloads a captured artifact by its storage key.
Auto Trait Implementations§
impl !RefUnwindSafe for ErrorSnapshotter
impl !UnwindSafe for ErrorSnapshotter
impl Freeze for ErrorSnapshotter
impl Send for ErrorSnapshotter
impl Sync for ErrorSnapshotter
impl Unpin for ErrorSnapshotter
impl UnsafeUnpin for ErrorSnapshotter
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