pub enum EngineError {
UnknownSource {
name: String,
configured: String,
},
Token {
message: String,
},
NoSources,
NotWritable {
name: String,
kind: String,
},
DestinationUnavailable {
name: String,
error: SourceError,
},
NoSuchItem {
id: String,
},
StaleOrigin {
item: String,
origin: String,
},
SourceRefused {
name: String,
error: SourceError,
},
CopyNotUndone {
error: Box<EngineError>,
left_behind: LeftBehind,
refusal: SourceError,
},
}Expand description
What the engine refuses before it asks any source.
Distinct from a SourceFailure, which is one source failing while the others
answer: everything here means the request itself cannot be run at all.
Eq is deliberately absent: three variants carry the SourceError the source
itself gave, which is what a user has to act on, and that type is PartialEq alone.
Variants§
UnknownSource
A --source named something no configuration configures.
Fields
Token
A --page token that decodes but does not belong to this query.
NoSources
Nothing at all is configured, so there is nothing to ask.
NotWritable
A copy named a destination whose plugin has no write side.
A copy named a destination that is configured but could not be built.
NoSuchItem
A copy named an id its own source does not hold.
StaleOrigin
An item’s recorded origin names an item the destination no longer holds.
Refused rather than created: the destination item was deleted or moved on purpose, and creating a second one there would duplicate work somebody removed.
SourceRefused
A source refused something the copy asked of it.
Distinct from a SourceFailure, which leaves the other sources’ results
standing: a copy is one write into one destination, and half of one is not an
answer.
CopyNotUndone
A copy failed, and the destination could not be put back the way it was found.
A copy is either complete or it never happened, and the engine undoes its own writes to make that true. When the destination will not take one of them back, the failure has to say so and name what is still there: a user told only that the copy failed would copy again over a destination nobody has described to them, which is the retry that trips a hosted destination’s rate limiter.
Fields
error: Box<EngineError>Why the copy failed in the first place.
left_behind: LeftBehindThe items the copy created or overwrote and could not take back.
The ids themselves rather than a sentence about them: a caller acting on this —
removing them, or reporting them — needs the ids, and the joined form only the
message needs is LeftBehind’s own Display.
refusal: SourceErrorWhat the destination said when the copy tried to take them back.
Trait Implementations§
Source§impl Clone for EngineError
impl Clone for EngineError
Source§fn clone(&self) -> EngineError
fn clone(&self) -> EngineError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EngineError
impl Debug for EngineError
Source§impl Display for EngineError
impl Display for EngineError
Source§impl Error for EngineError
impl Error for EngineError
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()