#[non_exhaustive]pub enum Error {
Show 17 variants
NoSuchBranch(String),
BranchExists(String),
CannotDiscardDefaultBranch(String),
NoSuchCommit(CommitId),
BadCommitId(String),
NoSuchSeq {
branch: String,
seq: u64,
head_seq: u64,
},
KeyTooLong(usize),
EmptyKey,
BadImportance(f32),
DimensionMismatch {
expected: usize,
got: usize,
},
EmptyEmbedding,
Conflict {
branch: String,
expected: CommitId,
actual: CommitId,
},
MergeConflict {
keys: Vec<String>,
},
NoCommonAncestor {
from_branch: String,
into_branch: String,
},
BadBranchName(String),
Journal(String),
BadQueryDimension {
expected: usize,
got: usize,
},
}Expand description
Every fallible engine operation returns this error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoSuchBranch(String)
The named branch does not exist.
BranchExists(String)
A branch with that name already exists.
CannotDiscardDefaultBranch(String)
main is the root of history and cannot be discarded (DESIGN §4.2).
NoSuchCommit(CommitId)
The referenced commit is not in the graph.
BadCommitId(String)
A commit id could not be parsed from hex.
NoSuchSeq
No commit on this branch has that sequence number.
Fields
KeyTooLong(usize)
Keys are UTF-8 and at most crate::MAX_KEY_BYTES bytes (DESIGN §4.1).
EmptyKey
Keys may not be empty.
BadImportance(f32)
Importance is a probability-like weight in [0, 1] (DESIGN §4.1).
DimensionMismatch
The embedding dimension is fixed per database on first insert (DESIGN §4.1).
Fields
EmptyEmbedding
An embedding was supplied with no values.
Conflict
The branch head moved while a transaction was open; retry (DESIGN §4.3).
Fields
MergeConflict
A Fail-policy merge found keys changed on both sides (DESIGN §4.2).
NoCommonAncestor
The two branches share no common ancestor, so there is nothing to merge against.
Fields
BadBranchName(String)
A branch name did not meet the naming rules.
Journal(String)
A change could not be recorded durably, so it did not happen.
BadQueryDimension
A search query vector did not match the database dimension.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()