pub struct ResponseStore { /* private fields */ }Expand description
Response storage operations.
Implementations§
Source§impl ResponseStore
impl ResponseStore
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Creates a disabled response store (no persistence).
Useful for testing or when response storage is not configured.
Sourcepub fn new(pool: Arc<DbPool>) -> Self
pub fn new(pool: Arc<DbPool>) -> Self
Creates a new response store with database pool.
§Arguments
pool- Connection pool for database access
Sourcepub async fn get(&self, response_id: &str) -> StoreResult<ResponseData>
pub async fn get(&self, response_id: &str) -> StoreResult<ResponseData>
Retrieves a response by ID.
§Errors
Returns error if response not found, database query fails, or store is disabled.
Sourcepub async fn rehydrate(&self, response_id: &str) -> StoreResult<Vec<InOutItem>>
pub async fn rehydrate(&self, response_id: &str) -> StoreResult<Vec<InOutItem>>
Rehydrates a response with full history.
Fetches all history items referenced by a response.
§Errors
Returns error if database query fails or store is disabled.
Sourcepub async fn persist(
&self,
response_id: &str,
previous_response_id: Option<&str>,
new_items: Vec<InOutItem>,
metadata: &ResponseMetadata,
) -> StoreResult<()>
pub async fn persist( &self, response_id: &str, previous_response_id: Option<&str>, new_items: Vec<InOutItem>, metadata: &ResponseMetadata, ) -> StoreResult<()>
Persists a response with its items and metadata.
Creates items and stores the associated response record.
§Errors
Returns StorageError if database operation fails or store is disabled.
Trait Implementations§
Source§impl Clone for ResponseStore
impl Clone for ResponseStore
Source§fn clone(&self) -> ResponseStore
fn clone(&self) -> ResponseStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ResponseStore
impl !UnwindSafe for ResponseStore
impl Freeze for ResponseStore
impl Send for ResponseStore
impl Sync for ResponseStore
impl Unpin for ResponseStore
impl UnsafeUnpin for ResponseStore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more