Skip to main content

PeeringError

Enum PeeringError 

Source
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: VersionWindow

This device’s window.

§theirs: VersionWindow

The peer’s advertised window.

§update: UpdateDevice

Which 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

§pinned: u64

The pinned directory’s version.

§highest: u64

The highest version this device has verified.

§

PeerDirectoryStale

The peer presented a device directory older than the one this device pins.

Fields

§theirs: u64

The version the peer presented.

§ours: u64

The version 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

§kind: String

The peer’s stable name for the refusal.

§message: String

The peer’s English detail.

§

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§

Source§

impl PeeringError

Source

pub fn kind(&self) -> &'static str

The stable name a --json report and a channel refusal carry this error under. One per variant; never renamed.

Trait Implementations§

Source§

impl Debug for PeeringError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PeeringError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for PeeringError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BackupError> for PeeringError

Source§

fn from(source: BackupError) -> Self

Converts to this type from the input type.
Source§

impl From<CryptoError> for PeeringError

Source§

fn from(source: CryptoError) -> Self

Converts to this type from the input type.
Source§

impl From<PeeringError> for DelegationError

Source§

fn from(source: PeeringError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>
where T: Sized,

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more