pub struct StorageError<C>where
C: RaftTypeConfig,{ /* private fields */ }Expand description
Error that occurs when operating the store.
It indicates a data crash. An application returning this error will shut down the Openraft node immediately to prevent further damage.
Implementations§
Source§impl<C> StorageError<C>where
C: RaftTypeConfig,
impl<C> StorageError<C>where
C: RaftTypeConfig,
Sourcepub fn into_io(self) -> Option<StorageError<C>>
👎Deprecated since 0.10.0: no need to call this method
pub fn into_io(self) -> Option<StorageError<C>>
no need to call this method
Backward compatible with old form StorageError::IO{ source: StorageError }
Sourcepub fn from_io_error(
subject: ErrorSubject<C>,
verb: ErrorVerb,
io_error: Error,
) -> Self
pub fn from_io_error( subject: ErrorSubject<C>, verb: ErrorVerb, io_error: Error, ) -> Self
Create a StorageError from a std::io::Error.
Source§impl<C> StorageError<C>where
C: RaftTypeConfig,
impl<C> StorageError<C>where
C: RaftTypeConfig,
Sourcepub fn new(
subject: ErrorSubject<C>,
verb: ErrorVerb,
source: C::ErrorSource,
) -> Self
pub fn new( subject: ErrorSubject<C>, verb: ErrorVerb, source: C::ErrorSource, ) -> Self
Create a new StorageError.
Sourcepub fn write_log_entry(log_id: LogIdOf<C>, source: C::ErrorSource) -> Self
pub fn write_log_entry(log_id: LogIdOf<C>, source: C::ErrorSource) -> Self
Create an error for writing a log entry.
Sourcepub fn read_log_at_index(log_index: u64, source: C::ErrorSource) -> Self
pub fn read_log_at_index(log_index: u64, source: C::ErrorSource) -> Self
Create an error for reading a log entry at an index.
Sourcepub fn read_log_entry(log_id: LogIdOf<C>, source: C::ErrorSource) -> Self
pub fn read_log_entry(log_id: LogIdOf<C>, source: C::ErrorSource) -> Self
Create an error for reading a log entry.
Sourcepub fn write_logs(source: C::ErrorSource) -> Self
pub fn write_logs(source: C::ErrorSource) -> Self
Create an error for writing multiple log entries.
Sourcepub fn read_logs(source: C::ErrorSource) -> Self
pub fn read_logs(source: C::ErrorSource) -> Self
Create an error for reading multiple log entries.
Sourcepub fn write_vote(source: C::ErrorSource) -> Self
pub fn write_vote(source: C::ErrorSource) -> Self
Create an error for writing vote state.
Sourcepub fn read_vote(source: C::ErrorSource) -> Self
pub fn read_vote(source: C::ErrorSource) -> Self
Create an error for reading vote state.
Sourcepub fn apply(log_id: LogIdOf<C>, source: C::ErrorSource) -> Self
pub fn apply(log_id: LogIdOf<C>, source: C::ErrorSource) -> Self
Create an error for applying a log entry to the state machine.
Sourcepub fn write_state_machine(source: C::ErrorSource) -> Self
pub fn write_state_machine(source: C::ErrorSource) -> Self
Create an error for writing to the state machine.
Sourcepub fn read_state_machine(source: C::ErrorSource) -> Self
pub fn read_state_machine(source: C::ErrorSource) -> Self
Create an error for reading from the state machine.
Sourcepub fn write_snapshot(
signature: Option<SnapshotSignatureOf<C>>,
source: C::ErrorSource,
) -> Self
pub fn write_snapshot( signature: Option<SnapshotSignatureOf<C>>, source: C::ErrorSource, ) -> Self
Create an error for writing a snapshot.
Sourcepub fn read_snapshot(
signature: Option<SnapshotSignatureOf<C>>,
source: C::ErrorSource,
) -> Self
pub fn read_snapshot( signature: Option<SnapshotSignatureOf<C>>, source: C::ErrorSource, ) -> Self
Create an error for reading a snapshot.
Sourcepub fn read(source: C::ErrorSource) -> Self
pub fn read(source: C::ErrorSource) -> Self
General read error
Sourcepub fn write(source: C::ErrorSource) -> Self
pub fn write(source: C::ErrorSource) -> Self
General write error
Trait Implementations§
Source§impl<C> Clone for StorageError<C>
impl<C> Clone for StorageError<C>
Source§impl<C> Debug for StorageError<C>
impl<C> Debug for StorageError<C>
Source§impl<'de, C> Deserialize<'de> for StorageError<C>where
C: RaftTypeConfig,
impl<'de, C> Deserialize<'de> for StorageError<C>where
C: RaftTypeConfig,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<C> Display for StorageError<C>where
C: RaftTypeConfig,
impl<C> Display for StorageError<C>where
C: RaftTypeConfig,
impl<C> Eq for StorageError<C>
Source§impl<C> Error for StorageError<C>
impl<C> Error for StorageError<C>
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<C> From<StorageError<C>> for Fatal<C>where
C: RaftTypeConfig,
impl<C> From<StorageError<C>> for Fatal<C>where
C: RaftTypeConfig,
Source§fn from(source: StorageError<C>) -> Self
fn from(source: StorageError<C>) -> Self
Source§impl<C, E> From<StorageError<C>> for RaftError<C, E>where
C: RaftTypeConfig,
impl<C, E> From<StorageError<C>> for RaftError<C, E>where
C: RaftTypeConfig,
Source§fn from(se: StorageError<C>) -> Self
fn from(se: StorageError<C>) -> Self
Source§impl<C> From<StorageError<C>> for Errorwhere
C: RaftTypeConfig,
impl<C> From<StorageError<C>> for Errorwhere
C: RaftTypeConfig,
Source§fn from(e: StorageError<C>) -> Self
fn from(e: StorageError<C>) -> Self
Source§impl<C: RaftTypeConfig> From<StorageError<C>> for StreamingError<C>
impl<C: RaftTypeConfig> From<StorageError<C>> for StreamingError<C>
Source§fn from(source: StorageError<C>) -> Self
fn from(source: StorageError<C>) -> Self
Source§impl<C> PartialEq for StorageError<C>
impl<C> PartialEq for StorageError<C>
Source§impl<C> Serialize for StorageError<C>where
C: RaftTypeConfig,
impl<C> Serialize for StorageError<C>where
C: RaftTypeConfig,
impl<C> StructuralPartialEq for StorageError<C>
Auto Trait Implementations§
impl<C> Forget for StorageError<C>
impl<C> Freeze for StorageError<C>
impl<C> Move for StorageError<C>
impl<C> RefUnwindSafe for StorageError<C>
impl<C> Send for StorageError<C>
impl<C> Sync for StorageError<C>
impl<C> Unpin for StorageError<C>
impl<C> UnsafeUnpin for StorageError<C>
impl<C> UnwindSafe for StorageError<C>
Blanket Implementations§
impl<T> AppData for T
impl<T> AppDataResponse for Twhere
T: OptionalFeatures + 'static,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more