pub struct UnreadableSlice {
pub encoding: Option<String>,
pub error: String,
}Expand description
An introspect reply that arrived and could not be read as a registry
slice (RFC 08 §6, v1.44; #491): what it declared, and the first line of
why it did not read.
Three causes land here, and the shape does not tell them apart because
the reader does not need it to — the error line does: a declared
Encoding that is neither spelling (application/json), a document
malformed in the spelling it declared (a TOML file declared
application/kdl is read as KDL, never sniffed back), or one that
parses but is not a slice.
Fields§
§encoding: Option<String>The reply’s Encoding, verbatim — None when it declared none,
which is itself the fact (the undeclared row of RFC 08 §6’s table
reads as TOML), not an unasked question.
error: StringThe parse error’s first line. A TOML error’s later lines are a caret diagram of the source, which a table row cannot carry and a script does not want.
Implementations§
Source§impl UnreadableSlice
impl UnreadableSlice
Sourcepub fn new(encoding: Option<String>, error: &dyn Display) -> UnreadableSlice
pub fn new(encoding: Option<String>, error: &dyn Display) -> UnreadableSlice
From the reply’s declared encoding and whatever refused it — the
first line of its Display, trimmed.
Sourcepub fn sentence(&self) -> String
pub fn sentence(&self) -> String
The one sentence both explorers draw (#491): “introspect answered,
slice unreadable (application/kdl: …)” — the house counterpart of
“no introspect reply — capabilities unknown, not absent”, and like
it a statement about the fetch, never about the producer’s
capabilities.
Trait Implementations§
Source§impl Clone for UnreadableSlice
impl Clone for UnreadableSlice
Source§impl Debug for UnreadableSlice
impl Debug for UnreadableSlice
impl Eq for UnreadableSlice
Source§impl PartialEq for UnreadableSlice
impl PartialEq for UnreadableSlice
Source§impl Serialize for UnreadableSlice
impl Serialize for UnreadableSlice
impl StructuralPartialEq for UnreadableSlice
Auto Trait Implementations§
impl Freeze for UnreadableSlice
impl RefUnwindSafe for UnreadableSlice
impl Send for UnreadableSlice
impl Sync for UnreadableSlice
impl Unpin for UnreadableSlice
impl UnsafeUnpin for UnreadableSlice
impl UnwindSafe for UnreadableSlice
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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