base_web_content/accepted.rs
1// Released under the MIT License.
2// Copyright, 2026, by Samuel Williams.
3
4use std::fmt;
5
6/// Content that parsed and satisfied its declaration.
7#[non_exhaustive]
8pub struct Accepted<T, H> {
9 /// The declared struct.
10 pub content: T,
11 /// The handles of uploads that a later upload for the same field replaced, which the caller should remove.
12 pub discarded: Vec<H>,
13}
14
15/// Shows the number of discarded handles only, since the content holds submitted values.
16impl<T, H> fmt::Debug for Accepted<T, H> {
17 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
18 formatter
19 .debug_struct("Accepted")
20 .field("discarded", &self.discarded.len())
21 .finish_non_exhaustive()
22 }
23}