#[non_exhaustive]pub enum MemoryError {
Backend(MemoryBackendError),
Policy(String),
Internal(String),
}Expand description
Errors produced by a ConversationMemory backend.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Backend(MemoryBackendError)
The backing store failed to load, append, or clear messages.
Policy(String)
A history-shaping filter or policy rejected the loaded history.
Internal(String)
An internal invariant was violated (e.g. a poisoned in-process lock).
Distinct from MemoryError::Backend, which is reserved for failures
of the underlying conversation store.
Implementations§
Source§impl MemoryError
impl MemoryError
Sourcepub fn backend<E>(source: E) -> Selfwhere
E: Into<MemoryBackendError>,
pub fn backend<E>(source: E) -> Selfwhere
E: Into<MemoryBackendError>,
Wrap an arbitrary error from a backend implementation.
Trait Implementations§
Source§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
Source§impl Error for MemoryError
impl Error for MemoryError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<MemoryError> for PromptError
Surface crate::memory::ConversationMemory failures through the existing
CompletionError::RequestError variant so adding memory support does not
require a new top-level PromptError arm in downstream exhaustive matchers.
impl From<MemoryError> for PromptError
Surface crate::memory::ConversationMemory failures through the existing
CompletionError::RequestError variant so adding memory support does not
require a new top-level PromptError arm in downstream exhaustive matchers.
Source§fn from(err: MemoryError) -> Self
fn from(err: MemoryError) -> Self
Source§impl From<MemoryError> for StreamingError
Surface crate::memory::ConversationMemory failures through the existing
CompletionError::RequestError variant so adding memory support does not
require a new top-level StreamingError arm.
impl From<MemoryError> for StreamingError
Surface crate::memory::ConversationMemory failures through the existing
CompletionError::RequestError variant so adding memory support does not
require a new top-level StreamingError arm.
Source§fn from(err: MemoryError) -> Self
fn from(err: MemoryError) -> Self
Auto Trait Implementations§
impl Freeze for MemoryError
impl !RefUnwindSafe for MemoryError
impl Send for MemoryError
impl Sync for MemoryError
impl Unpin for MemoryError
impl UnsafeUnpin for MemoryError
impl !UnwindSafe for MemoryError
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
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> 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.