pub enum PeerError {
NotFound {
name: String,
},
NotGrafted {
at: String,
name: String,
interface: String,
},
Unavailable {
reason: String,
},
ShapeMismatch {
wanted: String,
got: String,
methods: Vec<String>,
},
Timeout,
Forbidden {
grant: String,
},
}Expand description
Why a peer could not be returned — each failure typed, on the wire as an
error item whose error_kind is the variant’s snake_case name, its fields
beside it.
Variants§
NotFound
No peer by this name.
NotGrafted
A graft point with nothing grafted under this name (GRAFT-1).
The peer is there but cannot be reached.
ShapeMismatch
The peer serves another shape: wanted and got are interface
hashes, methods the methods missing or changed.
Timeout
The peer did not answer in time.
Forbidden
The caller may not reach this peer.
Implementations§
Source§impl PeerError
impl PeerError
Sourcepub fn to_remote(&self) -> RemoteError
pub fn to_remote(&self) -> RemoteError
As the typed error an error item carries: a kind plexus-client does
not know is RemoteError::Other with its fields; forbidden is the
known refusal, naming the grant.
Sourcepub fn from_remote(e: &RemoteError) -> Option<PeerError>
pub fn from_remote(e: &RemoteError) -> Option<PeerError>
Back from the typed error an error item carries, when it is one.
Sourcepub fn from_item(item: &PlexusStreamItem) -> Option<PeerError>
pub fn from_item(item: &PlexusStreamItem) -> Option<PeerError>
From an error item, when it carries one.
Sourcepub fn from_client(e: &ClientError) -> PeerError
pub fn from_client(e: &ClientError) -> PeerError
From a client’s failure: a typed peer error the server sent, else the peer unavailable, saying why.
Sourcepub fn item(&self, provenance: Vec<String>) -> PlexusStreamItem
pub fn item(&self, provenance: Vec<String>) -> PlexusStreamItem
The error item a caller gets for it.
Sourcepub fn stream(&self, provenance: Vec<String>) -> PlexusStream
pub fn stream(&self, provenance: Vec<String>) -> PlexusStream
A stream of the one error item.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PeerError
impl<'de> Deserialize<'de> for PeerError
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>,
impl Eq for PeerError
Source§impl Error for PeerError
impl Error for PeerError
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 PeerError
impl JsonSchema for PeerError
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 moreimpl StructuralPartialEq for PeerError
Auto Trait Implementations§
impl Forget for PeerError
impl Freeze for PeerError
impl RefUnwindSafe for PeerError
impl Send for PeerError
impl Sync for PeerError
impl Unpin for PeerError
impl UnsafeUnpin for PeerError
impl UnwindSafe for PeerError
Blanket Implementations§
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.