1use embassy_net::tcp;
2use embassy_net::tcp::ConnectError;
3use embassy_sync::channel::TryReceiveError;
4
5pub type SocketResult<T> = Result<T, SocketErr>;
7
8#[derive(Debug)]
10pub enum SocketErr {
11 TcpError(tcp::Error),
13 ConnectError(tcp::ConnectError),
15 TryReceiveError(TryReceiveError)
17}
18
19impl From<tcp::Error> for SocketErr {
21 #[inline]
22 fn from(value: tcp::Error) -> Self {
23 Self::TcpError(value)
24 }
25}
26
27impl From<tcp::ConnectError> for SocketErr {
29 fn from(value: ConnectError) -> Self {
30 Self::ConnectError(value)
31 }
32}
33
34impl From<TryReceiveError> for SocketErr {
36 fn from(value: TryReceiveError) -> Self {
37 Self::TryReceiveError(value)
38 }
39}