pub enum PeeringError {
Show 21 variants
Tls(String),
Io(String),
VersionDisjoint {
ours: VersionWindow,
theirs: VersionWindow,
update: UpdateDevice,
},
ForeignIdentity,
DirectoryRollback {
pinned: u64,
highest: u64,
},
PeerDirectoryStale {
theirs: u64,
ours: u64,
},
RateLimited(IpAddr),
OutOfScope(FetchScope),
UnknownDevice(Uuid),
RevokedDevice(Uuid),
SelfPeer(Uuid),
HybridCheckFailed,
Discovery(String),
Codec(String),
Crypto(CryptoError),
Backup(BackupError),
Transfer(String),
Timeout(&'static str),
PeerRefused {
kind: String,
message: String,
},
NotLan(IpAddr),
Directory(String),
}Expand description
Everything peering can fail with. Peering is best-effort — a caller treats most of these as “no peer / fall back to server sync” — but the identity-check variants are load-bearing security rejections that must never be silently downgraded.
Variants§
Tls(String)
A TLS handshake, config, or certificate-generation failure.
Io(String)
A socket read/write failure on the peering channel.
VersionDisjoint
The two devices’ peering-protocol windows share no version. The channel is torn down
before any payload byte, and update names the device that must update.
Fields
ours: VersionWindowThis device’s window.
theirs: VersionWindowThe peer’s advertised window.
update: UpdateDeviceWhich device must update for the windows to meet.
ForeignIdentity
The peer’s pinned directory is not signed by the User IK we trust — a foreign identity.
DirectoryRollback
The pinned device directory is older than one this device has already verified: a stale directory could readmit a revoked device.
Fields
PeerDirectoryStale
The peer presented a device directory older than the one this device pins.
RateLimited(IpAddr)
The source address exceeded the handshake rate limit.
OutOfScope(FetchScope)
The receiver’s synchronization scope does not eagerly hold originals, which every backup artifact carries; the receiver syncs from the server instead.
UnknownDevice(Uuid)
The peer presented a device_id that is absent from our pinned device directory: it is
not one of this user’s enrolled devices.
RevokedDevice(Uuid)
The peer’s directory entry carries a revoked_at: a removed device cannot peer.
SelfPeer(Uuid)
The peer’s hello claims this device’s own device_id: a hello reflected back at its
sender, or a device dialing itself. A device never peers with itself.
HybridCheckFailed
The application-layer hybrid signature over the channel-binding did not verify under the peer’s published device key — the peer does not hold the private key it claims.
Discovery(String)
A discovery-layer failure (advertise/browse).
Codec(String)
A framing / serialization failure exchanging the handshake hello.
Crypto(CryptoError)
An underlying cryptographic failure (e.g. a hardware signer refusing to sign the proof).
Backup(BackupError)
A failure opening, verifying, or restoring the transferred backup artifact.
Transfer(String)
The ranged artifact transfer failed (drop budget exhausted, integrity mismatch).
Timeout(&'static str)
The peer did not complete a read or write on the channel within its bound: the handshake
within channel::HANDSHAKE_TIMEOUT, a frame within the channel’s I/O timeout.
PeerRefused
The peer answered a request with a refusal. kind is the peer’s stable name for why
(one of PeeringError::kind or DelegationError::kind); it is the peer’s claim,
reported, never acted on as a fact about this device.
Fields
NotLan(IpAddr)
The address is not on the local network: peering is LAN-only (is_lan).
Directory(String)
The account’s device directory could not be fetched to authorize a request; the request is refused rather than served under trust that may be stale (fail closed).
Implementations§
Trait Implementations§
Source§impl Debug for PeeringError
impl Debug for PeeringError
Source§impl Display for PeeringError
impl Display for PeeringError
Source§impl Error for PeeringError
impl Error for PeeringError
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 From<BackupError> for PeeringError
impl From<BackupError> for PeeringError
Source§fn from(source: BackupError) -> Self
fn from(source: BackupError) -> Self
Source§impl From<CryptoError> for PeeringError
impl From<CryptoError> for PeeringError
Source§fn from(source: CryptoError) -> Self
fn from(source: CryptoError) -> Self
Source§impl From<PeeringError> for DelegationError
impl From<PeeringError> for DelegationError
Source§fn from(source: PeeringError) -> Self
fn from(source: PeeringError) -> Self
Auto Trait Implementations§
impl Freeze for PeeringError
impl RefUnwindSafe for PeeringError
impl Send for PeeringError
impl Sync for PeeringError
impl Unpin for PeeringError
impl UnsafeUnpin for PeeringError
impl UnwindSafe for PeeringError
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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