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

facet-rs / facet / 14546339941

19 Apr 2025 06:02AM UTC coverage: 43.858% (+0.2%) from 43.653%
14546339941

Pull #301

github

web-flow
Merge 7525b4cce into 4c26162f7
Pull Request #301: feat(json) Better error messages when a field is missing

20 of 41 new or added lines in 3 files covered. (48.78%)

1 existing line in 1 file now uncovered.

4813 of 10974 relevant lines covered (43.86%)

49.52 hits per line

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

0.0
/facet-core/src/lib.rs
1
#![cfg_attr(not(feature = "std"), no_std)]
2
#![warn(missing_docs)]
3
#![warn(clippy::std_instead_of_core)]
4
#![warn(clippy::std_instead_of_alloc)]
5
#![doc = include_str!("../README.md")]
6

7
#[cfg(feature = "alloc")]
8
extern crate alloc;
9

10
mod macros;
11
pub use macros::*;
12

13
// Opaque pointer utilities
14
mod ptr;
15
pub use ptr::*;
16

17
// Specialization utilities
18
pub mod spez;
19

20
// Definition for `core::` types
21
mod impls_core;
22

23
// Definition for `alloc::` types
24
#[cfg(feature = "alloc")]
25
mod impls_alloc;
26

27
// Definition for `std::` types (that aren't in `alloc` or `core)
28
#[cfg(feature = "std")]
29
mod impls_std;
30

31
#[cfg(feature = "camino")]
32
mod impls_camino;
33

34
// Const type Id
35
mod typeid;
36
pub use typeid::*;
37

38
// Type definitions
39
mod types;
40
#[allow(unused_imports)] // wtf clippy? we're re-exporting?
41
pub use types::*;
42

43
/// Allows querying the [`Shape`] of a type, which in turn lets us inspect any fields, build a value of
44
/// this type progressively, etc.
45
///
46
/// # Safety
47
///
48
/// If you implement this wrong, all the safe abstractions in `facet-reflect`,
49
/// all the serializers, deserializers, the entire ecosystem is unsafe.
50
///
51
/// You're responsible for describing the type layout properly, and annotating all the invariants.
52
pub unsafe trait Facet: Sized {
53
    /// The shape of this type
54
    const SHAPE: &'static Shape;
55

56
    /// Returns true if the type of `self` is equal to the type of `other`
57
    fn type_eq<Other: Facet>() -> bool {
×
58
        Self::SHAPE == Other::SHAPE
×
59
    }
×
60
}
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

© 2025 Coveralls, Inc