#[non_exhaustive]pub enum Error {
Device(Error),
Registration(RegistrationError),
InvalidControlUrl(ParseError),
InvalidAddr {
addr: String,
source: AddrParseError,
},
AddrFamilyMismatch {
addr: String,
want: &'static str,
},
UnsupportedNetwork {
network: String,
},
InvalidNetwork {
network: String,
},
Store(Error),
State(Error),
Logout(LogoutError),
Loopback(Error),
}Expand description
The unified error for Server’s lifecycle surface (start/up/dial/listen/…).
Go returns a single opaque error everywhere; this fork returns typed errors. Error is the
Go-shaped unification for the lifecycle path only — the specialized calls that already carry rich
typed errors keep them, wrapped so a lazy-start failure stays distinct from the engine error:
Server::listen_funnel → ListenFunnelError (over ts_control::FunnelError),
Server::listen_service → ListenServiceError (over ServiceError).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Device(Error)
The wrapped Device/engine returned an error.
Registration(RegistrationError)
Registration did not reach Running (Go Up failure). Carries the typed, actionable reason
(permanent vs transient vs needs-login) — richer than Go’s status blob.
InvalidControlUrl(ParseError)
Server::control_url was set but is not a valid URL.
InvalidAddr
A Go-style network, addr string could not be parsed into a SocketAddr.
AddrFamilyMismatch
A family-pinned listen network ("tcp4"/"tcp6") was given an explicit host literal of the
other address family — e.g. Server::listen("tcp4", "[::1]:80"). Go’s net.Listen
rejects the same mismatch (tcp4 binds only IPv4 addresses, tcp6 only IPv6). A bare
":port" never trips this: it is filled with the family’s own wildcard host first.
Fields
UnsupportedNetwork
A Go-style dial network string was not one of the supported
"tcp"/"tcp4"/"tcp6"/"udp"/"udp4"/"udp6" (Go’s Dial likewise rejects an unknown
network). Reported by Server::dial at the facade boundary, before the device is started.
InvalidNetwork
The Go-style network string was not one the call accepts. Server::listen takes a stream
network ("tcp", "tcp4", "tcp6"); Server::listen_packet a packet network ("udp",
"udp4", "udp6"). An unknown string, or the wrong transport for the call (e.g. "udp"
passed to listen), lands here — mirroring Go’s net.Listen/net.ListenPacket rejecting a
bad network with net.UnknownNetworkError.
Store(Error)
The StateStore backing Server::dir/Server::store failed an I/O operation.
State(Error)
The persisted node identity could not be (de)serialized.
Logout(LogoutError)
A Server::logout call failed.
Loopback(Error)
The loopback proxy / in-process LocalAPI HTTP server hit an I/O error (binding its
127.0.0.1 listener, or a LocalClient request to it).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<Error> for ListenFunnelError
impl From<Error> for ListenFunnelError
Source§impl From<Error> for ListenServiceError
impl From<Error> for ListenServiceError
Source§impl From<LogoutError> for Error
impl From<LogoutError> for Error
Source§fn from(source: LogoutError) -> Self
fn from(source: LogoutError) -> Self
Source§impl From<RegistrationError> for Error
impl From<RegistrationError> for Error
Source§fn from(source: RegistrationError) -> Self
fn from(source: RegistrationError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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> DisplayExt for Twhere
T: Display,
impl<T> DisplayExt for Twhere
T: Display,
Source§fn as_display_debug(&self) -> DisplayToDebug<'_>
fn as_display_debug(&self) -> DisplayToDebug<'_>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<A, T> DynMessage<A> for T
impl<A, T> DynMessage<A> for T
Source§fn handle_dyn<'a>(
self: Box<T>,
state: &'a mut A,
actor_ref: ActorRef<A>,
tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>,
stop: &'a mut bool,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
fn handle_dyn<'a>( self: Box<T>, state: &'a mut A, actor_ref: ActorRef<A>, tx: Option<Sender<Result<Box<dyn Any + Send>, SendError<Box<dyn Any + Send>, Box<dyn Any + Send>>>>>, stop: &'a mut bool, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn ReplyError>>> + Send + 'a>>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> ReplyError for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more