pub enum RoundError {
Unreachable(String),
Refused(LinkRefusal),
NoLink,
}Expand description
What a dial or a sync round did not do. The three are kept apart because they are acted on differently: an unreachable peer is retried with a backoff, a refusal is a decision that will be made the same way next time and is recorded rather than retried, and the absence of a link is this runtime’s own state and not the peer’s.
use majordomus_cli::mesh::cooperation::RoundError;
// nobody answers at the discard port: a peer to back off from, not a decision
let nobody = cooperation.dial(&["127.0.0.1:9".into()]).unwrap_err();
assert!(matches!(nobody, RoundError::Unreachable(_)), "{nobody}");
assert!(nobody.to_string().contains("127.0.0.1:9"), "a failure names where it was going");
// and syncing with a peer this runtime never linked to is its own state, not the peer's
let never = cooperation.sync_with("somebody-0000000000000002").unwrap_err();
assert!(matches!(never, RoundError::NoLink), "{never}");Variants§
Unreachable(String)
No endpoint answered.
Refused(LinkRefusal)
The peer, or this runtime’s check of the peer, refused.
NoLink
There is no outbound link to sync.
Trait Implementations§
Source§impl Clone for RoundError
impl Clone for RoundError
Source§fn clone(&self) -> RoundError
fn clone(&self) -> RoundError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoundError
impl Debug for RoundError
Auto Trait Implementations§
impl Freeze for RoundError
impl RefUnwindSafe for RoundError
impl Send for RoundError
impl Sync for RoundError
impl Unpin for RoundError
impl UnsafeUnpin for RoundError
impl UnwindSafe for RoundError
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
Mutably borrows from an owned value. Read more