• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kaidokert / winc-rs / 13756448917

10 Mar 2025 03:49AM UTC coverage: 68.346%. Remained the same
13756448917

Pull #37

github

kaidokert
Split async demos to separate crate
Pull Request #37: Move async

50 of 54 new or added lines in 4 files covered. (92.59%)

148 existing lines in 5 files now uncovered.

2239 of 3276 relevant lines covered (68.35%)

1901.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/winc-rs/src/stack/stack_error.rs
1
use crate::manager::WifiConnError;
2

3
use crate::manager::SocketError;
4

5
use embedded_nal::nb;
6

7
/// Stack errors
8
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9
#[derive(Debug, PartialEq)]
10
pub enum StackError {
11
    WouldBlock,
12
    GeneralTimeout,
13
    /// TCP connection timed out
14
    ConnectTimeout,
15
    RecvTimeout,
16
    SendTimeout,
17
    OutOfSockets,
18
    SocketAlreadyInUse,
19
    CloseFailed,
20
    Unexpected,
21
    DispatchError(crate::errors::Error),
22
    ConnectSendFailed(crate::errors::Error),
23
    ReceiveFailed(crate::errors::Error),
24
    SendSendFailed(crate::errors::Error),
25
    SendCloseFailed(crate::errors::Error),
26
    BindFailed(crate::errors::Error),
27
    WincWifiFail(crate::errors::Error),
28
    OpFailed(SocketError),
29
    /// DNS lookup timed out
30
    DnsTimeout,
31
    /// Unexpected DNS error
32
    DnsFailed,
33
    /// Operation was attempted in wrong state
34
    InvalidState,
35
    AlreadyConnected,
36
    /// Acess point join failed
37
    ApJoinFailed(WifiConnError),
38
    /// Scan operation failed
39
    ApScanFailed(WifiConnError),
40
}
41

42
impl From<core::convert::Infallible> for StackError {
UNCOV
43
    fn from(_: core::convert::Infallible) -> Self {
×
UNCOV
44
        unreachable!()
×
45
    }
46
}
47

48
impl From<SocketError> for StackError {
UNCOV
49
    fn from(inner: SocketError) -> Self {
×
UNCOV
50
        Self::OpFailed(inner)
×
UNCOV
51
    }
×
52
}
53

54
impl From<crate::errors::Error> for StackError {
UNCOV
55
    fn from(inner: crate::errors::Error) -> Self {
×
UNCOV
56
        Self::WincWifiFail(inner)
×
UNCOV
57
    }
×
58
}
59

60
impl embedded_nal::TcpError for StackError {
UNCOV
61
    fn kind(&self) -> embedded_nal::TcpErrorKind {
×
UNCOV
62
        embedded_nal::TcpErrorKind::Other
×
UNCOV
63
    }
×
64
}
65

66
impl From<nb::Error<StackError>> for StackError {
67
    fn from(inner: nb::Error<StackError>) -> Self {
×
UNCOV
68
        match inner {
×
69
            nb::Error::WouldBlock => StackError::WouldBlock,
×
UNCOV
70
            nb::Error::Other(e) => e,
×
71
        }
UNCOV
72
    }
×
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc