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

facet-rs / facet / 16482855623

23 Jul 2025 10:08PM UTC coverage: 58.447% (-0.2%) from 58.68%
16482855623

Pull #855

github

web-flow
Merge dca4c2302 into 5e8e214d1
Pull Request #855: wip: Remove 'shape lifetime

400 of 572 new or added lines in 70 files covered. (69.93%)

3 existing lines in 3 files now uncovered.

11939 of 20427 relevant lines covered (58.45%)

120.58 hits per line

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

22.73
/facet-msgpack/src/errors.rs
1
use core::fmt;
2

3
use facet_reflect::ReflectError;
4

5
#[derive(Debug)]
6
/// Errors that can occur during MessagePack encoding/decoding operations
7
pub enum Error {
8
    /// Encountered a MessagePack type that doesn't match the expected type
9
    UnexpectedType,
10
    /// Not enough data available to decode a complete MessagePack value
11
    InsufficientData,
12
    /// The MessagePack data is malformed or corrupted
13
    InvalidData,
14
    /// Encountered a field name that isn't recognized
15
    UnknownField(String),
16
    /// Required field is missing from the input
17
    MissingField(String),
18
    /// Integer value is too large for the target type
19
    IntegerOverflow,
20
    /// Shape is not supported for deserialization
21
    UnsupportedShape(String),
22
    /// Type is not supported for deserialization
23
    UnsupportedType(String),
24
    /// Feature not yet implemented
25
    NotImplemented(String),
26
    /// Reflection error
27
    ReflectError(ReflectError),
28
    /// Invalid enum variant
29
    InvalidEnum(String),
30
}
31

32
impl From<ReflectError> for Error {
NEW
33
    fn from(err: ReflectError) -> Self {
×
34
        Self::ReflectError(err)
×
35
    }
×
36
}
37

38
impl fmt::Display for Error {
39
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2✔
40
        match self {
2✔
41
            Error::UnexpectedType => write!(f, "Unexpected MessagePack type"),
1✔
42
            Error::InsufficientData => write!(f, "Insufficient data to decode"),
1✔
43
            Error::InvalidData => write!(f, "Invalid MessagePack data"),
×
44
            Error::UnknownField(field) => write!(f, "Unknown field: {field}"),
×
45
            Error::MissingField(field) => write!(f, "Missing required field: {field}"),
×
46
            Error::IntegerOverflow => write!(f, "Integer value too large for target type"),
×
47
            Error::UnsupportedShape(shape) => {
×
48
                write!(f, "Unsupported shape for deserialization: {shape}")
×
49
            }
50
            Error::UnsupportedType(typ) => {
×
51
                write!(f, "Unsupported type for deserialization: {typ}")
×
52
            }
53
            Error::NotImplemented(feature) => {
×
54
                write!(f, "Feature not yet implemented: {feature}")
×
55
            }
56
            Error::ReflectError(err) => {
×
57
                write!(f, "Reflection error: {err}")
×
58
            }
59
            Error::InvalidEnum(message) => {
×
60
                write!(f, "Invalid enum variant: {message}")
×
61
            }
62
        }
63
    }
2✔
64
}
65

66
impl std::error::Error for Error {}
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