use embassy_net::tcp;
use embassy_net::tcp::ConnectError;
use embassy_sync::channel::TryReceiveError;
pub type SocketResult<T> = Result<T, SocketErr>;
#[derive(Debug)]
pub enum SocketErr {
TcpError(tcp::Error),
ConnectError(tcp::ConnectError),
TryReceiveError(TryReceiveError)
}
impl From<tcp::Error> for SocketErr {
#[inline]
fn from(value: tcp::Error) -> Self {
Self::TcpError(value)
}
}
impl From<tcp::ConnectError> for SocketErr {
fn from(value: ConnectError) -> Self {
Self::ConnectError(value)
}
}
impl From<TryReceiveError> for SocketErr {
fn from(value: TryReceiveError) -> Self {
Self::TryReceiveError(value)
}
}