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

kaidokert / winc-rs / 13794761270

11 Mar 2025 05:48PM UTC coverage: 76.986% (+8.9%) from 68.079%
13794761270

Pull #39

github

web-flow
Merge 052756912 into e66120ff8
Pull Request #39: Added TCP stack unit tests for client module

97 of 107 new or added lines in 1 file covered. (90.65%)

103 existing lines in 5 files now uncovered.

2636 of 3424 relevant lines covered (76.99%)

2166.89 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
    /// Internal for delaying
41
    CallDelay,
42
    /// Dispatch event
43
    Dispatch,
44
}
45

46
impl From<core::convert::Infallible> for StackError {
UNCOV
47
    fn from(_: core::convert::Infallible) -> Self {
×
UNCOV
48
        unreachable!()
×
49
    }
50
}
51

52
impl From<SocketError> for StackError {
UNCOV
53
    fn from(inner: SocketError) -> Self {
×
UNCOV
54
        Self::OpFailed(inner)
×
55
    }
×
56
}
57

58
impl From<crate::errors::Error> for StackError {
UNCOV
59
    fn from(inner: crate::errors::Error) -> Self {
×
UNCOV
60
        Self::WincWifiFail(inner)
×
61
    }
×
62
}
63

64
impl embedded_nal::TcpError for StackError {
UNCOV
65
    fn kind(&self) -> embedded_nal::TcpErrorKind {
×
UNCOV
66
        embedded_nal::TcpErrorKind::Other
×
67
    }
×
68
}
69

70
impl From<nb::Error<StackError>> for StackError {
UNCOV
71
    fn from(inner: nb::Error<StackError>) -> Self {
×
72
        match inner {
×
UNCOV
73
            nb::Error::WouldBlock => StackError::WouldBlock,
×
UNCOV
74
            nb::Error::Other(e) => e,
×
75
        }
UNCOV
76
    }
×
77
}
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