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

facet-rs / facet / 19773611466

28 Nov 2025 08:51PM UTC coverage: 60.353% (-0.5%) from 60.902%
19773611466

Pull #956

github

web-flow
Merge bead07a00 into 628cd558c
Pull Request #956: Add DynamicValue support for deserializing into facet_value::Value

416 of 900 new or added lines in 19 files covered. (46.22%)

289 existing lines in 4 files now uncovered.

16743 of 27742 relevant lines covered (60.35%)

153.21 hits per line

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

78.15
/facet-reflect/src/partial/partial_api/misc.rs
1
use super::*;
2

3
////////////////////////////////////////////////////////////////////////////////////////////////////
4
// Misc.
5
////////////////////////////////////////////////////////////////////////////////////////////////////
6
impl<'facet> Partial<'facet> {
7
    /// Returns the current frame count (depth of nesting)
8
    ///
9
    /// The initial frame count is 1 — `begin_field` would push a new frame,
10
    /// bringing it to 2, then `end` would bring it back to `1`.
11
    ///
12
    /// This is an implementation detail of `Partial`, kinda, but deserializers
13
    /// might use this for debug assertions, to make sure the state is what
14
    /// they think it is.
15
    #[inline]
16
    pub fn frame_count(&self) -> usize {
28✔
17
        self.frames().len()
28✔
18
    }
28✔
19

20
    /// Returns the shape of the current frame.
21
    #[inline]
22
    pub fn shape(&self) -> &'static Shape {
13,662✔
23
        self.frames()
13,662✔
24
            .last()
13,662✔
25
            .expect("Partial always has at least one frame")
13,662✔
26
            .shape
13,662✔
27
    }
13,662✔
28

29
    /// Returns the current deferred resolution, if in deferred mode.
30
    #[inline]
31
    pub fn deferred_resolution(&self) -> Option<&Resolution> {
3✔
32
        self.resolution()
3✔
33
    }
3✔
34

35
    /// Returns the current path in deferred mode as a slice (for debugging/tracing).
36
    #[inline]
37
    pub fn current_path_slice(&self) -> Option<&[&'static str]> {
×
38
        self.current_path().map(|p| p.as_slice())
×
39
    }
×
40

41
    /// Enables deferred materialization mode with the given Resolution.
42
    ///
43
    /// When deferred mode is enabled:
44
    /// - `end()` stores frames instead of validating them
45
    /// - Re-entering a path restores the stored frame with its state intact
46
    /// - `finish_deferred()` performs final validation and materialization
47
    ///
48
    /// This allows deserializers to handle interleaved fields (e.g., TOML dotted
49
    /// keys, flattened structs) where nested fields aren't contiguous in the input.
50
    ///
51
    /// # Use Cases
52
    ///
53
    /// - TOML dotted keys: `inner.x = 1` followed by `count = 2` then `inner.y = 3`
54
    /// - Flattened structs where nested fields appear at the parent level
55
    /// - Any format where field order doesn't match struct nesting
56
    ///
57
    /// # Errors
58
    ///
59
    /// Returns an error if already in deferred mode.
60
    #[inline]
61
    pub fn begin_deferred(&mut self, resolution: Resolution) -> Result<&mut Self, ReflectError> {
421✔
62
        // Cannot enable deferred mode if already in deferred mode
63
        if self.is_deferred() {
421✔
64
            return Err(ReflectError::InvariantViolation {
1✔
65
                invariant: "begin_deferred() called but already in deferred mode",
1✔
66
            });
1✔
67
        }
420✔
68

69
        // Take the stack out of Strict mode and wrap in Deferred mode
70
        let FrameMode::Strict { stack } = core::mem::replace(
420✔
71
            &mut self.mode,
420✔
72
            FrameMode::Strict { stack: Vec::new() }, // temporary placeholder
420✔
73
        ) else {
420✔
74
            unreachable!("just checked we're not in deferred mode");
×
75
        };
76

77
        let start_depth = stack.len();
420✔
78
        self.mode = FrameMode::Deferred {
420✔
79
            stack,
420✔
80
            resolution,
420✔
81
            start_depth,
420✔
82
            current_path: Vec::new(),
420✔
83
            stored_frames: BTreeMap::new(),
420✔
84
        };
420✔
85
        Ok(self)
420✔
86
    }
421✔
87

88
    /// Finishes deferred mode: validates all stored frames and finalizes.
89
    ///
90
    /// This method:
91
    /// 1. Validates that all stored frames are fully initialized
92
    /// 2. Processes frames from deepest to shallowest, updating parent ISets
93
    /// 3. Validates the root frame
94
    ///
95
    /// # Errors
96
    ///
97
    /// Returns an error if any required fields are missing or if the partial is
98
    /// not in deferred mode.
99
    pub fn finish_deferred(&mut self) -> Result<&mut Self, ReflectError> {
339✔
100
        // Check if we're in deferred mode first, before extracting state
101
        if !self.is_deferred() {
339✔
102
            return Err(ReflectError::InvariantViolation {
2✔
103
                invariant: "finish_deferred() called but deferred mode is not enabled",
2✔
104
            });
2✔
105
        }
337✔
106

107
        // Extract deferred state, transitioning back to Strict mode
108
        let FrameMode::Deferred {
109
            stack,
337✔
110
            start_depth,
337✔
111
            mut stored_frames,
337✔
112
            ..
113
        } = core::mem::replace(&mut self.mode, FrameMode::Strict { stack: Vec::new() })
337✔
114
        else {
115
            unreachable!("just checked is_deferred()");
×
116
        };
117

118
        // Restore the stack to self.mode
119
        self.mode = FrameMode::Strict { stack };
337✔
120

121
        // Sort paths by depth (deepest first) so we process children before parents
122
        let mut paths: Vec<_> = stored_frames.keys().cloned().collect();
337✔
123
        paths.sort_by_key(|b| core::cmp::Reverse(b.len()));
1,580✔
124

125
        trace!(
126
            "finish_deferred: Processing {} stored frames in order: {:?}",
127
            paths.len(),
128
            paths
129
        );
130

131
        // Process each stored frame from deepest to shallowest
132
        for path in paths {
1,079✔
133
            let mut frame = stored_frames.remove(&path).unwrap();
746✔
134

135
            trace!(
136
                "finish_deferred: Processing frame at {:?}, shape {}, tracker {:?}",
137
                path,
138
                frame.shape,
139
                frame.tracker.kind()
140
            );
141

142
            // Fill in defaults for unset fields that have defaults
143
            frame.fill_defaults();
746✔
144

145
            // Validate the frame is fully initialized
146
            if let Err(e) = frame.require_full_initialization() {
746✔
147
                // Clean up the current frame that failed validation.
148
                // We need to check if the parent will drop it.
149
                let parent_will_drop = if path.len() == 1 {
4✔
150
                    let field_name = path.first().unwrap();
3✔
151
                    self.frames()
3✔
152
                        .first()
3✔
153
                        .is_some_and(|parent| Self::is_field_marked_in_parent(parent, field_name))
3✔
154
                } else {
155
                    false
1✔
156
                };
157

158
                let mut frame = frame; // Make mutable for deinit
4✔
159
                if !parent_will_drop {
4✔
160
                    // Always call deinit - it handles partially initialized structs/enums
4✔
161
                    // by checking the tracker's iset and dropping individual fields
4✔
162
                    frame.deinit();
4✔
163
                }
4✔
164

165
                // Clean up remaining stored frames before returning error.
166
                // When finish_deferred fails, the parent's iset was NEVER updated for any stored frame,
167
                // so we must deinit all initialized frames ourselves - the parent won't drop them.
168

169
                // Collect keys to remove (can't drain in no_std)
170
                let remaining_paths: Vec<_> = stored_frames.keys().cloned().collect();
4✔
171
                // Sort by depth (deepest first) for proper cleanup order
172
                let mut sorted_paths = remaining_paths;
4✔
173
                sorted_paths.sort_by_key(|p| core::cmp::Reverse(p.len()));
4✔
174

175
                for remaining_path in sorted_paths {
7✔
176
                    if let Some(mut remaining_frame) = stored_frames.remove(&remaining_path) {
3✔
177
                        // Check if this frame was re-entered (parent already has it marked as init).
178
                        // If so, the parent will drop it - we must NOT deinit (double-free).
179
                        // If not, we must deinit because the parent won't drop it.
180
                        let parent_will_drop = if remaining_path.len() == 1 {
3✔
181
                            // Parent is the root frame
182
                            let field_name = remaining_path.first().unwrap();
3✔
183
                            self.frames().first().is_some_and(|parent| {
3✔
184
                                Self::is_field_marked_in_parent(parent, field_name)
3✔
185
                            })
3✔
186
                        } else {
187
                            // Parent is a stored frame - but stored frames haven't been updated yet,
188
                            // so we need to check against what was already set before deferred mode.
189
                            // For now, conservatively assume parent won't drop nested frames.
190
                            false
×
191
                        };
192

193
                        if !parent_will_drop {
3✔
194
                            // Always call deinit - it handles partially initialized structs/enums
3✔
195
                            // by checking the tracker's iset and dropping individual fields
3✔
196
                            remaining_frame.deinit();
3✔
197
                        }
3✔
198
                    }
×
199
                }
200
                return Err(e);
4✔
201
            }
742✔
202

203
            // Update parent's ISet to mark this field as initialized.
204
            // The parent could be:
205
            // 1. On the frames stack (if path.len() == 1, parent is at start_depth - 1)
206
            // 2. On the frames stack (if parent was pushed but never ended)
207
            // 3. In stored_frames (if parent was ended during deferred mode)
208
            if let Some(field_name) = path.last() {
742✔
209
                let parent_path: Vec<_> = path[..path.len() - 1].to_vec();
742✔
210

211
                if parent_path.is_empty() {
742✔
212
                    // Parent is the frame that was current when deferred mode started.
213
                    // It's at index (start_depth - 1) because deferred mode stores frames
214
                    // relative to the position at start_depth.
215
                    let parent_index = start_depth.saturating_sub(1);
485✔
216
                    if let Some(root_frame) = self.frames_mut().get_mut(parent_index) {
485✔
217
                        Self::mark_field_initialized(root_frame, field_name);
485✔
218
                    }
485✔
219
                } else {
220
                    // Try stored_frames first
221
                    if let Some(parent_frame) = stored_frames.get_mut(&parent_path) {
257✔
222
                        Self::mark_field_initialized(parent_frame, field_name);
257✔
223
                    } else {
257✔
224
                        // Parent might still be on the frames stack (never ended).
225
                        // The frame at index (start_depth + parent_path.len() - 1) should be the parent.
226
                        let parent_frame_index = start_depth + parent_path.len() - 1;
×
227
                        if let Some(parent_frame) = self.frames_mut().get_mut(parent_frame_index) {
×
228
                            Self::mark_field_initialized(parent_frame, field_name);
×
229
                        }
×
230
                    }
231
                }
232
            }
×
233

234
            // Frame is validated and parent is updated - frame is no longer needed
235
            // (The actual data is already in place in memory, pointed to by parent)
236
            drop(frame);
742✔
237
        }
238

239
        // Fill defaults and validate the root frame is fully initialized
240
        if let Some(frame) = self.frames_mut().last_mut() {
333✔
241
            frame.fill_defaults();
333✔
242
            frame.require_full_initialization()?;
333✔
243
        }
×
244

245
        Ok(self)
329✔
246
    }
339✔
247

248
    /// Mark a field as initialized in a frame's tracker
249
    fn mark_field_initialized(frame: &mut Frame, field_name: &str) {
742✔
250
        if let Some(idx) = Self::find_field_index(frame, field_name) {
742✔
251
            match &mut frame.tracker {
740✔
252
                Tracker::Struct { iset, .. } => {
649✔
253
                    iset.set(idx);
649✔
254
                }
649✔
255
                Tracker::Enum { data, .. } => {
91✔
256
                    data.set(idx);
91✔
257
                }
91✔
258
                Tracker::Array { iset, .. } => {
×
259
                    iset.set(idx);
×
260
                }
×
261
                _ => {}
×
262
            }
263
        }
2✔
264
    }
742✔
265

266
    /// Find the field index for a given field name in a frame
267
    fn find_field_index(frame: &Frame, field_name: &str) -> Option<usize> {
762✔
268
        match frame.shape.ty {
762✔
269
            Type::User(UserType::Struct(struct_type)) => {
669✔
270
                struct_type.fields.iter().position(|f| f.name == field_name)
1,395✔
271
            }
272
            Type::User(UserType::Enum(_)) => {
273
                if let Tracker::Enum { variant, .. } = &frame.tracker {
93✔
274
                    variant
93✔
275
                        .data
93✔
276
                        .fields
93✔
277
                        .iter()
93✔
278
                        .position(|f| f.name == field_name)
112✔
279
                } else {
280
                    None
×
281
                }
282
            }
283
            _ => None,
×
284
        }
285
    }
762✔
286

287
    /// Check if a field is marked as initialized in the parent's iset/data tracker
288
    pub(crate) fn is_field_marked_in_parent(parent: &Frame, field_name: &str) -> bool {
16✔
289
        // First find the field index
290
        let idx = match Self::find_field_index(parent, field_name) {
16✔
291
            Some(idx) => idx,
16✔
292
            None => return false,
×
293
        };
294

295
        // Then check if it's marked in the parent's tracker
296
        match &parent.tracker {
16✔
297
            Tracker::Struct { iset, .. } => iset.get(idx),
16✔
298
            Tracker::Enum { data, .. } => data.get(idx),
×
299
            _ => false,
×
300
        }
301
    }
16✔
302

303
    /// Unmark a field from the parent's iset/data tracker
304
    /// Used when cleaning up stored frames to prevent double-free
305
    pub(crate) fn unmark_field_in_parent(parent: &mut Frame, field_name: &str) {
4✔
306
        // First find the field index
307
        let idx = match Self::find_field_index(parent, field_name) {
4✔
308
            Some(idx) => idx,
4✔
309
            None => return,
×
310
        };
311

312
        // Then unmark it in the parent's tracker
313
        match &mut parent.tracker {
4✔
314
            Tracker::Struct { iset, .. } => iset.unset(idx),
4✔
315
            Tracker::Enum { data, .. } => data.unset(idx),
×
316
            _ => {}
×
317
        }
318
    }
4✔
319

320
    /// Pops the current frame off the stack, indicating we're done initializing the current field
321
    pub fn end(&mut self) -> Result<&mut Self, ReflectError> {
3,277✔
322
        if let Some(_frame) = self.frames().last() {
3,277✔
323
            crate::trace!(
3,277✔
324
                "end() called: shape={}, tracker={:?}, is_init={}",
3,277✔
325
                _frame.shape,
3,277✔
326
                _frame.tracker.kind(),
3,277✔
327
                _frame.is_init
3,277✔
328
            );
3,277✔
329
        }
3,277✔
330
        self.require_active()?;
3,277✔
331

332
        // Special handling for SmartPointerSlice - convert builder to Arc
333
        if self.frames().len() == 1 {
3,277✔
334
            let frames = self.frames_mut();
14✔
335
            if let Tracker::SmartPointerSlice {
336
                vtable,
13✔
337
                building_item,
13✔
338
            } = &frames[0].tracker
14✔
339
            {
340
                if *building_item {
13✔
341
                    return Err(ReflectError::OperationFailed {
×
342
                        shape: frames[0].shape,
×
343
                        operation: "still building an item, finish it first",
×
344
                    });
×
345
                }
13✔
346

347
                // Convert the builder to Arc<[T]>
348
                let vtable = *vtable;
13✔
349
                let builder_ptr = unsafe { frames[0].data.assume_init() };
13✔
350
                let arc_ptr = unsafe { (vtable.convert_fn)(builder_ptr) };
13✔
351

352
                // Update the frame to store the Arc
353
                frames[0].data = PtrUninit::new(unsafe {
13✔
354
                    NonNull::new_unchecked(arc_ptr.as_byte_ptr() as *mut u8)
13✔
355
                });
13✔
356
                frames[0].tracker = Tracker::Scalar;
13✔
357
                frames[0].is_init = true;
13✔
358
                // The builder memory has been consumed by convert_fn, so we no longer own it
359
                frames[0].ownership = FrameOwnership::ManagedElsewhere;
13✔
360

361
                return Ok(self);
13✔
362
            }
1✔
363
        }
3,263✔
364

365
        if self.frames().len() <= 1 {
3,264✔
366
            // Never pop the last/root frame.
367
            return Err(ReflectError::InvariantViolation {
1✔
368
                invariant: "Partial::end() called with only one frame on the stack",
1✔
369
            });
1✔
370
        }
3,263✔
371

372
        // In deferred mode, cannot pop below the start depth
373
        if let Some(start_depth) = self.start_depth() {
3,263✔
374
            if self.frames().len() <= start_depth {
1,183✔
375
                return Err(ReflectError::InvariantViolation {
×
376
                    invariant: "Partial::end() called but would pop below deferred start depth",
×
377
                });
×
378
            }
1,183✔
379
        }
2,080✔
380

381
        // Require that the top frame is fully initialized before popping.
382
        // Skip this check in deferred mode - validation happens in finish_deferred().
383
        // EXCEPT for collection items (map, list, set, option) which must be fully
384
        // initialized before insertion/completion.
385
        let requires_full_init = if !self.is_deferred() {
3,263✔
386
            true
2,080✔
387
        } else {
388
            // In deferred mode, check if parent is a collection that requires
389
            // fully initialized items (map, list, set, option)
390
            if self.frames().len() >= 2 {
1,183✔
391
                let frame_len = self.frames().len();
1,183✔
392
                let parent_frame = &self.frames()[frame_len - 2];
1,183✔
393
                matches!(
931✔
394
                    parent_frame.tracker,
1✔
395
                    Tracker::Map { .. }
396
                        | Tracker::List { .. }
397
                        | Tracker::Set { .. }
398
                        | Tracker::Option { .. }
399
                        | Tracker::DynamicValue {
400
                            state: DynamicValueState::Array { .. }
401
                        }
402
                )
403
            } else {
404
                false
×
405
            }
406
        };
407

408
        if requires_full_init {
3,263✔
409
            let frame = self.frames().last().unwrap();
2,332✔
410
            crate::trace!(
411
                "end(): Checking full init for {}, tracker={:?}, is_init={}",
412
                frame.shape,
413
                frame.tracker.kind(),
414
                frame.is_init
415
            );
416
            let result = frame.require_full_initialization();
2,332✔
417
            crate::trace!(
418
                "end(): require_full_initialization result: {:?}",
419
                result.is_ok()
420
            );
421
            result?
2,332✔
422
        }
931✔
423

424
        // Pop the frame and save its data pointer for SmartPointer handling
425
        let mut popped_frame = self.frames_mut().pop().unwrap();
3,247✔
426

427
        // In deferred mode, store the frame for potential re-entry and skip
428
        // the normal parent-updating logic. The frame will be finalized later
429
        // in finish_deferred().
430
        //
431
        // We only store if the path depth matches the frame depth, meaning we're
432
        // ending a tracked struct/enum field, not something like begin_some()
433
        // or a field inside a collection item.
434
        if let FrameMode::Deferred {
435
            stack,
1,182✔
436
            start_depth,
1,182✔
437
            current_path,
1,182✔
438
            stored_frames,
1,182✔
439
            ..
440
        } = &mut self.mode
3,247✔
441
        {
442
            // Path depth should match the relative frame depth for a tracked field.
443
            // After popping: frames.len() - start_depth + 1 should equal path.len()
444
            // for fields entered via begin_field (not begin_some/begin_inner).
445
            let relative_depth = stack.len() - *start_depth + 1;
1,182✔
446
            let is_tracked_field = !current_path.is_empty() && current_path.len() == relative_depth;
1,182✔
447

448
            if is_tracked_field {
1,182✔
449
                trace!(
450
                    "end(): Storing frame for deferred path {:?}, shape {}",
451
                    current_path, popped_frame.shape
452
                );
453

454
                // Store the frame at the current path
455
                let path = current_path.clone();
830✔
456
                stored_frames.insert(path, popped_frame);
830✔
457

458
                // Pop from current_path
459
                current_path.pop();
830✔
460

461
                // Clear parent's current_child tracking
462
                if let Some(parent_frame) = stack.last_mut() {
830✔
463
                    parent_frame.tracker.clear_current_child();
830✔
464
                }
830✔
465

466
                return Ok(self);
830✔
467
            }
352✔
468
        }
2,065✔
469

470
        // check if this needs deserialization from a different shape
471
        if popped_frame.using_custom_deserialization {
2,417✔
472
            if let Some(deserialize_with) = self
19✔
473
                .parent_field()
19✔
474
                .and_then(|field| field.vtable.deserialize_with)
19✔
475
            {
476
                let parent_frame = self.frames_mut().last_mut().unwrap();
19✔
477

478
                trace!(
479
                    "Detected custom conversion needed from {} to {}",
480
                    popped_frame.shape, parent_frame.shape
481
                );
482

483
                unsafe {
484
                    let res = {
19✔
485
                        let inner_value_ptr = popped_frame.data.assume_init().as_const();
19✔
486
                        (deserialize_with)(inner_value_ptr, parent_frame.data)
19✔
487
                    };
488
                    let popped_frame_shape = popped_frame.shape;
19✔
489

490
                    // we need to do this before any error handling to avoid leaks
491
                    popped_frame.deinit();
19✔
492
                    popped_frame.dealloc();
19✔
493
                    let rptr = res.map_err(|message| ReflectError::CustomDeserializationError {
19✔
494
                        message,
2✔
495
                        src_shape: popped_frame_shape,
2✔
496
                        dst_shape: parent_frame.shape,
2✔
497
                    })?;
2✔
498
                    if rptr.as_uninit() != parent_frame.data {
17✔
499
                        return Err(ReflectError::CustomDeserializationError {
×
500
                            message: "deserialize_with did not return the expected pointer".into(),
×
501
                            src_shape: popped_frame_shape,
×
502
                            dst_shape: parent_frame.shape,
×
503
                        });
×
504
                    }
17✔
505
                    parent_frame.mark_as_init();
17✔
506
                }
507
                return Ok(self);
17✔
508
            }
×
509
        }
2,398✔
510

511
        // Update parent frame's tracking when popping from a child
512
        let parent_frame = self.frames_mut().last_mut().unwrap();
2,398✔
513

514
        crate::trace!(
515
            "end(): Popped {} (tracker {:?}), Parent {} (tracker {:?})",
516
            popped_frame.shape,
517
            popped_frame.tracker.kind(),
518
            parent_frame.shape,
519
            parent_frame.tracker.kind()
520
        );
521

522
        // Check if we need to do a conversion - this happens when:
523
        // 1. The parent frame has an inner type that matches the popped frame's shape
524
        // 2. The parent frame has try_from
525
        // 3. The parent frame is not yet initialized
526
        // 4. The parent frame's tracker is Scalar (not Option, SmartPointer, etc.)
527
        //    This ensures we only do conversion when begin_inner was used, not begin_some
528
        let needs_conversion = !parent_frame.is_init
2,398✔
529
            && matches!(parent_frame.tracker, Tracker::Scalar)
1,554✔
530
            && parent_frame.shape.inner.is_some()
43✔
531
            && parent_frame.shape.inner.unwrap() == popped_frame.shape
43✔
532
            && parent_frame.shape.vtable.try_from.is_some();
35✔
533

534
        if needs_conversion {
2,398✔
535
            trace!(
536
                "Detected implicit conversion needed from {} to {}",
537
                popped_frame.shape, parent_frame.shape
538
            );
539

540
            // The conversion requires the source frame to be fully initialized
541
            // (we're about to call assume_init() and pass to try_from)
542
            if let Err(e) = popped_frame.require_full_initialization() {
35✔
543
                // Deallocate the memory since the frame wasn't fully initialized
544
                if let FrameOwnership::Owned = popped_frame.ownership {
×
545
                    if let Ok(layout) = popped_frame.shape.layout.sized_layout() {
×
546
                        if layout.size() > 0 {
×
547
                            trace!(
548
                                "Deallocating uninitialized conversion frame memory: size={}, align={}",
549
                                layout.size(),
550
                                layout.align()
551
                            );
552
                            unsafe {
×
553
                                ::alloc::alloc::dealloc(
×
554
                                    popped_frame.data.as_mut_byte_ptr(),
×
555
                                    layout,
×
556
                                );
×
557
                            }
×
558
                        }
×
559
                    }
×
560
                }
×
561
                return Err(e);
×
562
            }
35✔
563

564
            // Perform the conversion
565
            if let Some(try_from_fn) = parent_frame.shape.vtable.try_from {
35✔
566
                let inner_ptr = unsafe { popped_frame.data.assume_init().as_const() };
35✔
567
                let inner_shape = popped_frame.shape;
35✔
568

569
                trace!("Converting from {} to {}", inner_shape, parent_frame.shape);
570
                let result = unsafe { try_from_fn(inner_ptr, inner_shape, parent_frame.data) };
35✔
571

572
                if let Err(e) = result {
35✔
573
                    trace!("Conversion failed: {e:?}");
574

575
                    // Deallocate the inner value's memory since conversion failed
576
                    if let FrameOwnership::Owned = popped_frame.ownership {
2✔
577
                        if let Ok(layout) = popped_frame.shape.layout.sized_layout() {
2✔
578
                            if layout.size() > 0 {
2✔
579
                                trace!(
580
                                    "Deallocating conversion frame memory after failure: size={}, align={}",
581
                                    layout.size(),
582
                                    layout.align()
583
                                );
584
                                unsafe {
2✔
585
                                    ::alloc::alloc::dealloc(
2✔
586
                                        popped_frame.data.as_mut_byte_ptr(),
2✔
587
                                        layout,
2✔
588
                                    );
2✔
589
                                }
2✔
590
                            }
×
591
                        }
×
592
                    }
×
593

594
                    return Err(ReflectError::TryFromError {
2✔
595
                        src_shape: inner_shape,
2✔
596
                        dst_shape: parent_frame.shape,
2✔
597
                        inner: e,
2✔
598
                    });
2✔
599
                }
33✔
600

601
                trace!("Conversion succeeded, marking parent as initialized");
602
                parent_frame.is_init = true;
33✔
603

604
                // Deallocate the inner value's memory since try_from consumed it
605
                if let FrameOwnership::Owned = popped_frame.ownership {
33✔
606
                    if let Ok(layout) = popped_frame.shape.layout.sized_layout() {
33✔
607
                        if layout.size() > 0 {
33✔
608
                            trace!(
609
                                "Deallocating conversion frame memory: size={}, align={}",
610
                                layout.size(),
611
                                layout.align()
612
                            );
613
                            unsafe {
33✔
614
                                ::alloc::alloc::dealloc(
33✔
615
                                    popped_frame.data.as_mut_byte_ptr(),
33✔
616
                                    layout,
33✔
617
                                );
33✔
618
                            }
33✔
619
                        }
×
620
                    }
×
621
                }
×
622

623
                return Ok(self);
33✔
624
            }
×
625
        }
2,363✔
626

627
        match &mut parent_frame.tracker {
617✔
628
            Tracker::Struct {
629
                iset,
1,138✔
630
                current_child,
1,138✔
631
            } => {
632
                if let Some(idx) = *current_child {
1,138✔
633
                    iset.set(idx);
1,138✔
634
                    *current_child = None;
1,138✔
635
                }
1,138✔
636
            }
637
            Tracker::Array {
638
                iset,
92✔
639
                current_child,
92✔
640
            } => {
641
                if let Some(idx) = *current_child {
92✔
642
                    iset.set(idx);
92✔
643
                    *current_child = None;
92✔
644
                }
92✔
645
            }
646
            Tracker::SmartPointer => {
647
                // We just popped the inner value frame, so now we need to create the smart pointer
648
                if let Def::Pointer(smart_ptr_def) = parent_frame.shape.def {
26✔
649
                    // The inner value must be fully initialized before we can create the smart pointer
650
                    if let Err(e) = popped_frame.require_full_initialization() {
26✔
651
                        // Inner value wasn't initialized, deallocate and return error
NEW
652
                        popped_frame.deinit();
×
NEW
653
                        popped_frame.dealloc();
×
NEW
654
                        return Err(e);
×
655
                    }
26✔
656

657
                    let Some(new_into_fn) = smart_ptr_def.vtable.new_into_fn else {
26✔
NEW
658
                        popped_frame.deinit();
×
NEW
659
                        popped_frame.dealloc();
×
660
                        return Err(ReflectError::OperationFailed {
×
661
                            shape: parent_frame.shape,
×
662
                            operation: "SmartPointer missing new_into_fn",
×
663
                        });
×
664
                    };
665

666
                    // The child frame contained the inner value
667
                    let inner_ptr = PtrMut::new(unsafe {
26✔
668
                        NonNull::new_unchecked(popped_frame.data.as_mut_byte_ptr())
26✔
669
                    });
670

671
                    // Use new_into_fn to create the Box
672
                    unsafe {
26✔
673
                        new_into_fn(parent_frame.data, inner_ptr);
26✔
674
                    }
26✔
675

676
                    // We just moved out of it
677
                    popped_frame.tracker = Tracker::Scalar;
26✔
678
                    popped_frame.is_init = false;
26✔
679

680
                    // Deallocate the inner value's memory since new_into_fn moved it
681
                    popped_frame.dealloc();
26✔
682

683
                    parent_frame.is_init = true;
26✔
684
                }
×
685
            }
686
            Tracker::Enum {
687
                data,
110✔
688
                current_child,
110✔
689
                ..
690
            } => {
691
                if let Some(idx) = *current_child {
110✔
692
                    data.set(idx);
110✔
693
                    *current_child = None;
110✔
694
                }
110✔
695
            }
696
            Tracker::List { current_child } if parent_frame.is_init => {
617✔
697
                if *current_child {
617✔
698
                    // We just popped an element frame, now push it to the list
699
                    if let Def::List(list_def) = parent_frame.shape.def {
617✔
700
                        let Some(push_fn) = list_def.vtable.push else {
617✔
701
                            return Err(ReflectError::OperationFailed {
×
702
                                shape: parent_frame.shape,
×
703
                                operation: "List missing push function",
×
704
                            });
×
705
                        };
706

707
                        // The child frame contained the element value
708
                        let element_ptr = PtrMut::new(unsafe {
617✔
709
                            NonNull::new_unchecked(popped_frame.data.as_mut_byte_ptr())
617✔
710
                        });
711

712
                        // Use push to add element to the list
713
                        unsafe {
617✔
714
                            push_fn(
617✔
715
                                PtrMut::new(NonNull::new_unchecked(
617✔
716
                                    parent_frame.data.as_mut_byte_ptr(),
617✔
717
                                )),
617✔
718
                                element_ptr,
617✔
719
                            );
617✔
720
                        }
617✔
721

722
                        // Push moved out of popped_frame
723
                        popped_frame.tracker = Tracker::Scalar;
617✔
724
                        popped_frame.is_init = false;
617✔
725
                        popped_frame.dealloc();
617✔
726

727
                        *current_child = false;
617✔
728
                    }
×
729
                }
×
730
            }
731
            Tracker::Map { insert_state } if parent_frame.is_init => {
181✔
732
                match insert_state {
181✔
733
                    MapInsertState::PushingKey { key_ptr, .. } => {
94✔
734
                        // We just popped the key frame - mark key as initialized and transition
94✔
735
                        // to PushingValue state
94✔
736
                        *insert_state = MapInsertState::PushingValue {
94✔
737
                            key_ptr: *key_ptr,
94✔
738
                            value_ptr: None,
94✔
739
                            value_initialized: false,
94✔
740
                        };
94✔
741
                    }
94✔
742
                    MapInsertState::PushingValue {
743
                        key_ptr, value_ptr, ..
87✔
744
                    } => {
745
                        // We just popped the value frame, now insert the pair
746
                        if let (Some(value_ptr), Def::Map(map_def)) =
87✔
747
                            (value_ptr, parent_frame.shape.def)
87✔
748
                        {
749
                            let insert_fn = map_def.vtable.insert_fn;
87✔
750

751
                            // Use insert to add key-value pair to the map
752
                            unsafe {
87✔
753
                                insert_fn(
87✔
754
                                    PtrMut::new(NonNull::new_unchecked(
87✔
755
                                        parent_frame.data.as_mut_byte_ptr(),
87✔
756
                                    )),
87✔
757
                                    PtrMut::new(NonNull::new_unchecked(key_ptr.as_mut_byte_ptr())),
87✔
758
                                    PtrMut::new(NonNull::new_unchecked(
87✔
759
                                        value_ptr.as_mut_byte_ptr(),
87✔
760
                                    )),
87✔
761
                                );
87✔
762
                            }
87✔
763

764
                            // Note: We don't deallocate the key and value memory here.
765
                            // The insert function has semantically moved the values into the map,
766
                            // but we still need to deallocate the temporary buffers.
767
                            // However, since we don't have frames for them anymore (they were popped),
768
                            // we need to handle deallocation here.
769
                            if let Ok(key_shape) = map_def.k().layout.sized_layout() {
87✔
770
                                if key_shape.size() > 0 {
87✔
771
                                    unsafe {
87✔
772
                                        ::alloc::alloc::dealloc(
87✔
773
                                            key_ptr.as_mut_byte_ptr(),
87✔
774
                                            key_shape,
87✔
775
                                        );
87✔
776
                                    }
87✔
777
                                }
×
778
                            }
×
779
                            if let Ok(value_shape) = map_def.v().layout.sized_layout() {
87✔
780
                                if value_shape.size() > 0 {
87✔
781
                                    unsafe {
87✔
782
                                        ::alloc::alloc::dealloc(
87✔
783
                                            value_ptr.as_mut_byte_ptr(),
87✔
784
                                            value_shape,
87✔
785
                                        );
87✔
786
                                    }
87✔
787
                                }
×
788
                            }
×
789

790
                            // Reset to idle state
791
                            *insert_state = MapInsertState::Idle;
87✔
792
                        }
×
793
                    }
794
                    MapInsertState::Idle => {
×
795
                        // Nothing to do
×
796
                    }
×
797
                }
798
            }
799
            Tracker::Set { current_child } if parent_frame.is_init => {
33✔
800
                if *current_child {
33✔
801
                    // We just popped an element frame, now insert it into the set
802
                    if let Def::Set(set_def) = parent_frame.shape.def {
33✔
803
                        let insert_fn = set_def.vtable.insert_fn;
33✔
804

33✔
805
                        // The child frame contained the element value
33✔
806
                        let element_ptr = PtrMut::new(unsafe {
33✔
807
                            NonNull::new_unchecked(popped_frame.data.as_mut_byte_ptr())
33✔
808
                        });
33✔
809

33✔
810
                        // Use insert to add element to the set
33✔
811
                        unsafe {
33✔
812
                            insert_fn(
33✔
813
                                PtrMut::new(NonNull::new_unchecked(
33✔
814
                                    parent_frame.data.as_mut_byte_ptr(),
33✔
815
                                )),
33✔
816
                                element_ptr,
33✔
817
                            );
33✔
818
                        }
33✔
819

33✔
820
                        // Insert moved out of popped_frame
33✔
821
                        popped_frame.tracker = Tracker::Scalar;
33✔
822
                        popped_frame.is_init = false;
33✔
823
                        popped_frame.dealloc();
33✔
824

33✔
825
                        *current_child = false;
33✔
826
                    }
33✔
827
                }
×
828
            }
829
            Tracker::Option { building_inner } => {
112✔
830
                crate::trace!(
831
                    "end(): matched Tracker::Option, building_inner={}",
832
                    *building_inner
833
                );
834
                // We just popped the inner value frame for an Option's Some variant
835
                if *building_inner {
112✔
836
                    if let Def::Option(option_def) = parent_frame.shape.def {
112✔
837
                        // Use the Option vtable to initialize Some(inner_value)
838
                        let init_some_fn = option_def.vtable.init_some_fn;
112✔
839

840
                        // The popped frame contains the inner value
841
                        let inner_value_ptr = unsafe { popped_frame.data.assume_init().as_const() };
112✔
842

843
                        // Initialize the Option as Some(inner_value)
844
                        unsafe {
112✔
845
                            init_some_fn(parent_frame.data, inner_value_ptr);
112✔
846
                        }
112✔
847

848
                        // Deallocate the inner value's memory since init_some_fn moved it
849
                        if let FrameOwnership::Owned = popped_frame.ownership {
112✔
850
                            if let Ok(layout) = popped_frame.shape.layout.sized_layout() {
112✔
851
                                if layout.size() > 0 {
112✔
852
                                    unsafe {
112✔
853
                                        ::alloc::alloc::dealloc(
112✔
854
                                            popped_frame.data.as_mut_byte_ptr(),
112✔
855
                                            layout,
112✔
856
                                        );
112✔
857
                                    }
112✔
858
                                }
×
859
                            }
×
860
                        }
×
861

862
                        // Mark that we're no longer building the inner value
863
                        *building_inner = false;
112✔
864
                        crate::trace!("end(): set building_inner to false");
865
                        // Mark the Option as initialized
866
                        parent_frame.is_init = true;
112✔
867
                        crate::trace!("end(): set parent_frame.is_init to true");
868
                    } else {
869
                        return Err(ReflectError::OperationFailed {
×
870
                            shape: parent_frame.shape,
×
871
                            operation: "Option frame without Option definition",
×
872
                        });
×
873
                    }
874
                } else {
875
                    // building_inner is false - the Option was already initialized but
876
                    // begin_some was called again. The popped frame was not used to
877
                    // initialize the Option, so we need to clean it up.
878
                    popped_frame.deinit();
×
879
                    if let FrameOwnership::Owned = popped_frame.ownership {
×
880
                        if let Ok(layout) = popped_frame.shape.layout.sized_layout() {
×
881
                            if layout.size() > 0 {
×
882
                                unsafe {
×
883
                                    ::alloc::alloc::dealloc(
×
884
                                        popped_frame.data.as_mut_byte_ptr(),
×
885
                                        layout,
×
886
                                    );
×
887
                                }
×
888
                            }
×
889
                        }
×
890
                    }
×
891
                }
892
            }
893
            Tracker::Scalar => {
894
                // the main case here is: the popped frame was a `String` and the
895
                // parent frame is an `Arc<str>`, `Box<str>` etc.
896
                match &parent_frame.shape.def {
8✔
897
                    Def::Pointer(smart_ptr_def) => {
8✔
898
                        let pointee =
8✔
899
                            smart_ptr_def
8✔
900
                                .pointee()
8✔
901
                                .ok_or(ReflectError::InvariantViolation {
8✔
902
                                    invariant: "pointer type doesn't have a pointee",
8✔
903
                                })?;
8✔
904

905
                        if !pointee.is_shape(str::SHAPE) {
8✔
906
                            return Err(ReflectError::InvariantViolation {
×
907
                                invariant: "only T=str is supported when building SmartPointer<T> and T is unsized",
×
908
                            });
×
909
                        }
8✔
910

911
                        if !popped_frame.shape.is_shape(String::SHAPE) {
8✔
912
                            return Err(ReflectError::InvariantViolation {
×
913
                                invariant: "the popped frame should be String when building a SmartPointer<T>",
×
914
                            });
×
915
                        }
8✔
916

917
                        popped_frame.require_full_initialization()?;
8✔
918

919
                        // if the just-popped frame was a SmartPointerStr, we have some conversion to do:
920
                        // Special-case: SmartPointer<str> (Box<str>, Arc<str>, Rc<str>) via SmartPointerStr tracker
921
                        // Here, popped_frame actually contains a value for String that should be moved into the smart pointer.
922
                        // We convert the String into Box<str>, Arc<str>, or Rc<str> as appropriate and write it to the parent frame.
923
                        use ::alloc::{rc::Rc, string::String, sync::Arc};
924
                        let parent_shape = parent_frame.shape;
8✔
925

926
                        let Some(known) = smart_ptr_def.known else {
8✔
927
                            return Err(ReflectError::OperationFailed {
×
928
                                shape: parent_shape,
×
929
                                operation: "SmartPointerStr for unknown smart pointer kind",
×
930
                            });
×
931
                        };
932

933
                        parent_frame.deinit();
8✔
934

935
                        // Interpret the memory as a String, then convert and write.
936
                        let string_ptr = popped_frame.data.as_mut_byte_ptr() as *mut String;
8✔
937
                        let string_value = unsafe { core::ptr::read(string_ptr) };
8✔
938

939
                        match known {
8✔
940
                            KnownPointer::Box => {
941
                                let boxed: Box<str> = string_value.into_boxed_str();
2✔
942
                                unsafe {
2✔
943
                                    core::ptr::write(
2✔
944
                                        parent_frame.data.as_mut_byte_ptr() as *mut Box<str>,
2✔
945
                                        boxed,
2✔
946
                                    );
2✔
947
                                }
2✔
948
                            }
949
                            KnownPointer::Arc => {
950
                                let arc: Arc<str> = Arc::from(string_value.into_boxed_str());
2✔
951
                                unsafe {
2✔
952
                                    core::ptr::write(
2✔
953
                                        parent_frame.data.as_mut_byte_ptr() as *mut Arc<str>,
2✔
954
                                        arc,
2✔
955
                                    );
2✔
956
                                }
2✔
957
                            }
958
                            KnownPointer::Rc => {
959
                                let rc: Rc<str> = Rc::from(string_value.into_boxed_str());
4✔
960
                                unsafe {
4✔
961
                                    core::ptr::write(
4✔
962
                                        parent_frame.data.as_mut_byte_ptr() as *mut Rc<str>,
4✔
963
                                        rc,
4✔
964
                                    );
4✔
965
                                }
4✔
966
                            }
967
                            _ => {
968
                                return Err(ReflectError::OperationFailed {
×
969
                                    shape: parent_shape,
×
970
                                    operation: "Don't know how to build this pointer type",
×
971
                                });
×
972
                            }
973
                        }
974

975
                        parent_frame.is_init = true;
8✔
976

977
                        popped_frame.tracker = Tracker::Scalar;
8✔
978
                        popped_frame.is_init = false;
8✔
979
                        popped_frame.dealloc();
8✔
980
                    }
981
                    _ => {
982
                        // This can happen if begin_inner() was called on a type that
983
                        // has shape.inner but isn't a SmartPointer (e.g., Option).
984
                        // In this case, we can't complete the conversion, so return error.
985
                        return Err(ReflectError::OperationFailed {
×
986
                            shape: parent_frame.shape,
×
987
                            operation: "end() called but parent has Uninit/Init tracker and isn't a SmartPointer",
×
988
                        });
×
989
                    }
990
                }
991
            }
992
            Tracker::SmartPointerSlice {
993
                vtable,
33✔
994
                building_item,
33✔
995
            } => {
996
                if *building_item {
33✔
997
                    // We just popped an element frame, now push it to the slice builder
998
                    let element_ptr = PtrMut::new(unsafe {
33✔
999
                        NonNull::new_unchecked(popped_frame.data.as_mut_byte_ptr())
33✔
1000
                    });
1001

1002
                    // Use the slice builder's push_fn to add the element
1003
                    crate::trace!("Pushing element to slice builder");
1004
                    unsafe {
33✔
1005
                        let parent_ptr = parent_frame.data.assume_init();
33✔
1006
                        (vtable.push_fn)(parent_ptr, element_ptr);
33✔
1007
                    }
33✔
1008

1009
                    popped_frame.tracker = Tracker::Scalar;
33✔
1010
                    popped_frame.is_init = false;
33✔
1011
                    popped_frame.dealloc();
33✔
1012

1013
                    if let Tracker::SmartPointerSlice {
1014
                        building_item: bi, ..
33✔
1015
                    } = &mut parent_frame.tracker
33✔
1016
                    {
33✔
1017
                        *bi = false;
33✔
1018
                    }
33✔
1019
                }
×
1020
            }
1021
            Tracker::DynamicValue {
1022
                state: DynamicValueState::Array { building_element },
13✔
1023
            } => {
1024
                if *building_element {
13✔
1025
                    // We just popped an element frame, now push it to the dynamic array
1026
                    if let Def::DynamicValue(dyn_def) = parent_frame.shape.def {
13✔
1027
                        // Get mutable pointers - both array and element need PtrMut
13✔
1028
                        let array_ptr = unsafe { parent_frame.data.assume_init() };
13✔
1029
                        let element_ptr = unsafe { popped_frame.data.assume_init() };
13✔
1030

13✔
1031
                        // Use push_array_element to add element to the array
13✔
1032
                        unsafe {
13✔
1033
                            (dyn_def.vtable.push_array_element)(array_ptr, element_ptr);
13✔
1034
                        }
13✔
1035

13✔
1036
                        // Push moved out of popped_frame
13✔
1037
                        popped_frame.tracker = Tracker::Scalar;
13✔
1038
                        popped_frame.is_init = false;
13✔
1039
                        popped_frame.dealloc();
13✔
1040

13✔
1041
                        *building_element = false;
13✔
1042
                    }
13✔
NEW
1043
                }
×
1044
            }
UNCOV
1045
            _ => {}
×
1046
        }
1047

1048
        Ok(self)
2,363✔
1049
    }
3,277✔
1050

1051
    /// Returns a human-readable path representing the current traversal in the builder,
1052
    /// e.g., `RootStruct.fieldName[index].subfield`.
1053
    pub fn path(&self) -> String {
364✔
1054
        let mut out = String::new();
364✔
1055

1056
        let mut path_components = Vec::new();
364✔
1057
        // The stack of enum/struct/sequence names currently in context.
1058
        // Start from root and build upwards.
1059
        for (i, frame) in self.frames().iter().enumerate() {
718✔
1060
            match frame.shape.ty {
718✔
1061
                Type::User(user_type) => match user_type {
600✔
1062
                    UserType::Struct(struct_type) => {
351✔
1063
                        // Try to get currently active field index
1064
                        let mut field_str = None;
351✔
1065
                        if let Tracker::Struct {
1066
                            current_child: Some(idx),
216✔
1067
                            ..
1068
                        } = &frame.tracker
220✔
1069
                        {
1070
                            if let Some(field) = struct_type.fields.get(*idx) {
216✔
1071
                                field_str = Some(field.name);
216✔
1072
                            }
216✔
1073
                        }
135✔
1074
                        if i == 0 {
351✔
1075
                            // Use Display for the root struct shape
272✔
1076
                            path_components.push(format!("{}", frame.shape));
272✔
1077
                        }
272✔
1078
                        if let Some(field_name) = field_str {
351✔
1079
                            path_components.push(format!(".{field_name}"));
216✔
1080
                        }
216✔
1081
                    }
1082
                    UserType::Enum(_enum_type) => {
15✔
1083
                        // Try to get currently active variant and field
1084
                        if let Tracker::Enum {
1085
                            variant,
4✔
1086
                            current_child,
4✔
1087
                            ..
1088
                        } = &frame.tracker
15✔
1089
                        {
1090
                            if i == 0 {
4✔
1091
                                // Use Display for the root enum shape
4✔
1092
                                path_components.push(format!("{}", frame.shape));
4✔
1093
                            }
4✔
1094
                            path_components.push(format!("::{}", variant.name));
4✔
1095
                            if let Some(idx) = *current_child {
4✔
1096
                                if let Some(field) = variant.data.fields.get(idx) {
4✔
1097
                                    path_components.push(format!(".{}", field.name));
4✔
1098
                                }
4✔
1099
                            }
×
1100
                        } else if i == 0 {
11✔
1101
                            // just the enum display
×
1102
                            path_components.push(format!("{}", frame.shape));
×
1103
                        }
11✔
1104
                    }
1105
                    UserType::Union(_union_type) => {
×
1106
                        path_components.push(format!("{}", frame.shape));
×
1107
                    }
×
1108
                    UserType::Opaque => {
234✔
1109
                        path_components.push("<opaque>".to_string());
234✔
1110
                    }
234✔
1111
                },
1112
                Type::Sequence(seq_type) => match seq_type {
×
1113
                    facet_core::SequenceType::Array(_array_def) => {
×
1114
                        // Try to show current element index
1115
                        if let Tracker::Array {
1116
                            current_child: Some(idx),
×
1117
                            ..
1118
                        } = &frame.tracker
×
1119
                        {
×
1120
                            path_components.push(format!("[{idx}]"));
×
1121
                        }
×
1122
                    }
1123
                    // You can add more for Slice, Vec, etc., if applicable
1124
                    _ => {
×
1125
                        // just indicate "[]" for sequence
×
1126
                        path_components.push("[]".to_string());
×
1127
                    }
×
1128
                },
1129
                Type::Pointer(_) => {
×
1130
                    // Indicate deref
×
1131
                    path_components.push("*".to_string());
×
1132
                }
×
1133
                _ => {
118✔
1134
                    // No structural path
118✔
1135
                }
118✔
1136
            }
1137
        }
1138
        // Merge the path_components into a single string
1139
        for component in path_components {
1,098✔
1140
            out.push_str(&component);
734✔
1141
        }
734✔
1142
        out
364✔
1143
    }
364✔
1144

1145
    /// Get the field for the parent frame
1146
    pub fn parent_field(&self) -> Option<&Field> {
145✔
1147
        self.frames()
145✔
1148
            .iter()
145✔
1149
            .rev()
145✔
1150
            .nth(1)
145✔
1151
            .and_then(|f| f.get_field())
145✔
1152
    }
145✔
1153

1154
    /// Gets the field for the current frame
1155
    pub fn current_field(&self) -> Option<&Field> {
×
1156
        self.frames().last().and_then(|f| f.get_field())
×
1157
    }
×
1158
}
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