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

facet-rs / facet / 19992174439

06 Dec 2025 05:56PM UTC coverage: 58.742% (-0.005%) from 58.747%
19992174439

Pull #1118

github

web-flow
Merge d1d251ac8 into 45a8cb1c3
Pull Request #1118: Reduce/cordon bloat in facet, introduce bloatbench

1138 of 3103 new or added lines in 61 files covered. (36.67%)

540 existing lines in 30 files now uncovered.

24225 of 41240 relevant lines covered (58.74%)

502.5 hits per line

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

33.33
/facet-core/src/types/def/array.rs
1
use crate::{PtrMut, ptr::PtrConst};
2

3
use super::Shape;
4

5
/// Fields for array types
6
#[derive(Clone, Copy, Debug)]
7
#[repr(C)]
8
pub struct ArrayDef {
9
    /// vtable for interacting with the array
10
    pub vtable: &'static ArrayVTable,
11

12
    /// shape of the items in the array
13
    pub t: &'static Shape,
14

15
    /// The length of the array
16
    pub n: usize,
17
}
18

19
impl ArrayDef {
20
    /// Construct an `ArrayDef` from its vtable, element shape, and length.
NEW
21
    pub const fn new(vtable: &'static ArrayVTable, t: &'static Shape, n: usize) -> Self {
×
NEW
22
        Self { vtable, t, n }
×
UNCOV
23
    }
×
24

25
    /// Returns the shape of the items in the array
26
    pub const fn t(&self) -> &'static Shape {
185✔
27
        self.t
185✔
28
    }
185✔
29
}
30

31
/// Get pointer to the data buffer of the array.
32
///
33
/// # Safety
34
///
35
/// The `array` parameter must point to aligned, initialized memory of the correct type.
36
pub type ArrayAsPtrFn = unsafe fn(array: PtrConst) -> PtrConst;
37

38
/// Get mutable pointer to the data buffer of the array.
39
///
40
/// # Safety
41
///
42
/// The `array` parameter must point to aligned, initialized memory of the correct type.
43
pub type ArrayAsMutPtrFn = unsafe fn(array: PtrMut) -> PtrMut;
44

45
/// Virtual table for an array
46
#[derive(Clone, Copy, Debug)]
47
#[repr(C)]
48
pub struct ArrayVTable {
49
    /// cf. [`ArrayAsPtrFn`]
50
    pub as_ptr: ArrayAsPtrFn,
51

52
    /// cf. [`ArrayAsMutPtrFn`]
53
    pub as_mut_ptr: ArrayAsMutPtrFn,
54
}
55

56
impl ArrayVTable {
57
    /// Const ctor for array vtable.
NEW
58
    pub const fn new(as_ptr: ArrayAsPtrFn, as_mut_ptr: ArrayAsMutPtrFn) -> Self {
×
NEW
59
        Self { as_ptr, as_mut_ptr }
×
UNCOV
60
    }
×
61
}
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