Enum veilid_tools::NetworkResult
source · pub enum NetworkResult<T> {
Timeout,
ServiceUnavailable(String),
NoConnection(Error),
AlreadyExists(Error),
InvalidMessage(String),
Value(T),
}
Variants§
Implementations§
source§impl<T> NetworkResult<T>
impl<T> NetworkResult<T>
pub fn timeout() -> Self
pub fn no_connection(e: Error) -> Self
pub fn no_connection_other<S: ToString>(s: S) -> Self
pub fn invalid_message<S: ToString>(s: S) -> Self
pub fn already_exists(e: Error) -> Self
pub fn value(value: T) -> Self
pub fn is_timeout(&self) -> bool
pub fn is_no_connection(&self) -> bool
pub fn is_already_exists(&self) -> bool
pub fn is_invalid_message(&self) -> bool
pub fn is_value(&self) -> bool
pub fn map<X, F: Fn(T) -> X>(self, f: F) -> NetworkResult<X>
pub fn into_io_result(self) -> Result<T, Error>
Trait Implementations§
source§impl<T: Debug> Debug for NetworkResult<T>
impl<T: Debug> Debug for NetworkResult<T>
source§impl<T> Display for NetworkResult<T>
impl<T> Display for NetworkResult<T>
source§impl<T: Debug + Display> Error for NetworkResult<T>
impl<T: Debug + Display> Error for NetworkResult<T>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<T> From<NetworkResult<T>> for Option<T>
impl<T> From<NetworkResult<T>> for Option<T>
source§fn from(t: NetworkResult<T>) -> Self
fn from(t: NetworkResult<T>) -> Self
Converts to this type from the input type.
source§impl<T, E> NetworkResultResultExt<T, E> for NetworkResult<Result<T, E>>
impl<T, E> NetworkResultResultExt<T, E> for NetworkResult<Result<T, E>>
fn into_result_network_result(self) -> Result<NetworkResult<T>, E>
Auto Trait Implementations§
impl<T> Freeze for NetworkResult<T>where
T: Freeze,
impl<T> !RefUnwindSafe for NetworkResult<T>
impl<T> Send for NetworkResult<T>where
T: Send,
impl<T> Sync for NetworkResult<T>where
T: Sync,
impl<T> Unpin for NetworkResult<T>where
T: Unpin,
impl<T> !UnwindSafe for NetworkResult<T>
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
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>
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 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>
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