pub enum SourceError {
Config {
message: String,
},
Auth {
message: String,
},
Refused {
message: String,
},
RateLimited {
retry_after_seconds: Option<u64>,
message: Option<String>,
},
Unavailable {
message: String,
},
Malformed {
message: String,
},
}Expand description
Why a source could not answer.
Every variant carries owned data only, so an error survives the JSON-over-stdio boundary a subprocess-hosted plugin crosses without losing anything.
Variants§
Config
The source’s configuration block is wrong, or names something absent.
Auth
The credential was missing, malformed, or rejected.
Refused
The source understood the request and declined it.
RateLimited
The source asked the caller to slow down.
A rate limit is the one refusal whose reason an operator cannot guess from the
kind alone. A hosted service typically has more than one limiter, only some of
them are reported by the endpoint an operator would go and check, and the right
next step differs between them — so a source that knows which one refused it, and
what it was doing when it did, says so in message
rather than leaving the operator to infer it and infer it wrong.
Fields
message: Option<String>What the source can add about which limit refused it and what it was doing.
Absent means the source had nothing to add beyond the kind, which is what every source said before this member existed; it is omitted from the wire entirely when absent, so a reader written against the shape without it sees exactly the shape it was written for. Never contains a credential.
The source could not be reached at all.
Malformed
The source answered with something this interface cannot represent.
Trait Implementations§
Source§impl Clone for SourceError
impl Clone for SourceError
Source§fn clone(&self) -> SourceError
fn clone(&self) -> SourceError
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 SourceError
impl Debug for SourceError
Source§impl<'de> Deserialize<'de> for SourceError
impl<'de> Deserialize<'de> for SourceError
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 Display for SourceError
impl Display for SourceError
Source§impl Error for SourceError
impl Error for SourceError
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 JsonSchema for SourceError
impl JsonSchema for SourceError
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more