pub enum ErrorCode {
Show 31 variants
Other = 10_000,
NotALeader = 10_001,
StorageCorrupted = 10_002,
TermMismatch = 10_003,
RaftLogUnavailable = 10_004,
RaftLogCompacted = 10_005,
CasNoSuchRaftIndex = 10_006,
CasConflictFound = 10_007,
CasEntryTermMismatch = 10_008,
CasTableNotAllowed = 10_009,
CasInvalidOpKind = 10_010,
NoSuchService = 10_011,
ServiceNotStarted = 10_012,
ServicePoisoned = 10_013,
ServiceNotAvailable = 10_014,
WrongPluginVersion = 10_015,
NoSuchInstance = 10_016,
NoSuchReplicaset = 10_017,
LeaderUnknown = 10_018,
PluginError = 10_019,
InstanceExpelled = 10_020,
ReplicasetExpelled = 10_021,
InstanceUnavaliable = 10_022,
CasTableNotOperable = 10_023,
Uninitialized = 10_024,
ExpelNotAllowed = 10_025,
CasConfigNotAllowed = 10_026,
RaftProposalDropped = 10_027,
SbroadError = 10_028,
RaftSnapshotReadViewNotAvailable = 10_029,
UserDefinedErrorCodesStart = 20_000,
}
Expand description
Error codes used with BoxError
which are only generated by picodata.
Variants§
Other = 10_000
This is the first picodata error code. Use this for errors which are hard to categorize and for which there’s no specific way of handling.
Also please use a unique error message for these kinds of errors, so it’s easy to find where it was generated in code.
If your error instead should be handled in a specific way please add a new one if the existing ones don’t satisfy your needs.
NotALeader = 10_001
Requested instance is not a leader.
StorageCorrupted = 10_002
Contents of a builtin table has invalid format.
TermMismatch = 10_003
Operation request from different term.
Raft log is temporarily unavailable.
RaftLogCompacted = 10_005
Can’t check the predicate because raft log is compacted.
CasNoSuchRaftIndex = 10_006
Nearly impossible error indicating invalid request.
CasConflictFound = 10_007
Checking the predicate revealed a collision.
CasEntryTermMismatch = 10_008
Request expected raft entry to have a different term.
CasTableNotAllowed = 10_009
SpaceNotAllowed: space {space} is prohibited for use in a predicate
CasInvalidOpKind = 10_010
Unexpected traft operation kind.
NoSuchService = 10_011
ServiceNotStarted = 10_012
ServicePoisoned = 10_013
ServiceNotAvailable = 10_014
WrongPluginVersion = 10_015
NoSuchInstance = 10_016
NoSuchReplicaset = 10_017
LeaderUnknown = 10_018
PluginError = 10_019
InstanceExpelled = 10_020
ReplicasetExpelled = 10_021
CasTableNotOperable = 10_023
TableNotOperable: table {table} is prohibited for use in a predicate
Uninitialized = 10_024
Picodata machinery is not yet initialized on the instance.
ExpelNotAllowed = 10_025
Instance is not allowed to be expelled in the given situation for
some reason. The most often solution is to use picodata expel --force
.
CasConfigNotAllowed = 10_026
TableNotOperable: table {table} is prohibited for use in a predicate
RaftProposalDropped = 10_027
Raft proposal was dropped by the leader.
SbroadError = 10_028
Generic sbroad error
RaftSnapshotReadViewNotAvailable = 10_029
A raft snapshot read view is not available.
UserDefinedErrorCodesStart = 20_000
Not an actual error code, just designates the start of the range.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const VARIANTS: &'static [Self]
pub const VARIANTS: &'static [Self]
A slice of all possible enum variants.
These are ordered in the order of definition in the source code.
Sourcepub const DISCRIMINANTS_ARE_SUBSEQUENT: bool = false
pub const DISCRIMINANTS_ARE_SUBSEQUENT: bool = false
If this is true
then all of the enum variants have subsequent
discriminants and converting from integer to enum type is going
to use a more efficient implementation.
Sourcepub const fn variant_name(&self) -> &'static str
pub const fn variant_name(&self) -> &'static str
Returns the name of the variant as it is spelled in the source code.
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn is_retriable_for_cas(&self) -> bool
pub fn is_retriable_for_cas(&self) -> bool
These types of errors signify different kinds of conflicts which can
occur during a compare_and_swap
RPC request. If such an error
happens it’s safe to retry the request under the following conditions:
- The raft read index operation is performed before each retry
- The preconditions of the request are checked before each retry
- The request is generated before each retry with an up to date raft index
Trait Implementations§
Source§impl Ord for ErrorCode
impl Ord for ErrorCode
Source§impl PartialOrd for ErrorCode
impl PartialOrd for ErrorCode
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.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,
Source§impl<T> IntoClones<(T,)> for Twhere
T: Clone,
impl<T> IntoClones<(T,)> for Twhere
T: Clone,
fn into_clones(self) -> (T,)
Source§impl<T> IntoClones<(T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T)
Source§impl<T> IntoClones<(T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T)
Source§impl<T> IntoClones<(T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T, T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T, T, T, T, T, T)
Source§impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
impl<T> IntoClones<(T, T, T, T, T, T, T, T, T, T, T)> for Twhere
T: Clone,
fn into_clones(self) -> (T, T, T, T, T, T, T, T, T, T, T)
Source§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset
. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset
. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset
. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset
. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read more