Skip to main content

sark_core/body/input/
mod.rs

1use o3::buffer::segments;
2
3mod checked;
4mod parts;
5pub(super) mod private;
6
7pub use checked::Checked;
8pub use parts::Parts;
9
10/// One ingress value and its exact wire-accounting dimensions.
11pub struct Input<D> {
12    data: D,
13    bytes: usize,
14    chunks: segments::Count,
15}
16
17impl<D> Input<D> {
18    pub const fn new(data: D, bytes: usize, chunks: segments::Count) -> Self {
19        Self {
20            data,
21            bytes,
22            chunks,
23        }
24    }
25
26    pub fn into_parts(self) -> (D, usize, segments::Count) {
27        (self.data, self.bytes, self.chunks)
28    }
29}