pub enum TunnelEnd {
Closed,
Refused {
code: u16,
reason: String,
},
Truncated {
code: Option<u16>,
},
ClosedUnproven,
}Expand description
What ended a tunnel, and whether the caller should treat it as a failure.
Exhaustive on purpose: a caller that matched a new way to end under a wildcard arm would report a stream cut short however that arm reports, which is the failure #342 fixed.
Variants§
Closed
The local client closed, or the guest reached EOF. The tunnel did its job.
On a verified tunnel whose daemon offered the end of stream, the guest’s EOF is read from the daemon’s end of stream, so every byte the guest sent arrived.
Refused
The daemon refused or lost the guest connection, with its close code.
Carries the code rather than a pre-rendered string so a caller can branch — a dead server is worth retrying against a different port, a relay failure is not.
Truncated
A verified tunnel’s daemon offered the end of stream, and the tunnel ended without it: a close frame with no failure code, a transport error, or a hangup (BIND-23).
A failure. Every byte that arrived authenticated, but the stream may have been cut short
on the path, or the guest may have stopped reading before all of the local bytes
reached it. code is the close frame’s, and None when there was no frame.
ClosedUnproven
A verified tunnel ended the way TunnelEnd::Closed does, but its daemon predates the
end of stream (its handshake didn’t offer one), so nothing proved the stream finished.
Not a failure: an older daemon never sends an end of stream, and failing here would fail every verified tunnel into an older image. A stream cut short would read the same, though, so a caller should say so.
Trait Implementations§
impl Eq for TunnelEnd
impl StructuralPartialEq for TunnelEnd
Auto Trait Implementations§
impl Freeze for TunnelEnd
impl RefUnwindSafe for TunnelEnd
impl Send for TunnelEnd
impl Sync for TunnelEnd
impl Unpin for TunnelEnd
impl UnsafeUnpin for TunnelEnd
impl UnwindSafe for TunnelEnd
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
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<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