pub enum Reassembly {
Complete {
count: usize,
},
Incomplete {
have: Vec<u32>,
missing: Vec<u32>,
missing_count: u64,
terminated: bool,
},
Orphan {
reason: OrphanReason,
have: Vec<u32>,
},
Empty,
}Expand description
What a run of partials adds up to.
Variants§
Complete
Every partial from the first to a terminal one is present.
Incomplete
The run starts correctly but has holes, or has not ended.
Fields
missing: Vec<u32>Sequence numbers missing between the ones present.
Truncated to PartialRun::MAX_REPORTED_MISSING; the exact figure
is always missing_count.
missing_count: u64How many sequence numbers are missing in total.
Separate from missing.len() because the list is bounded and this
is not: one corrupt sequence field claiming partial 4 294 967 295
would otherwise ask for a sixteen-gigabyte list of holes, and a
decoder that allocates on a number an attacker chose is a denial of
service with a domain name on it.
Orphan
The run cannot be completed from what arrived.
Either it does not begin at sequence 1, or its first record is reduced and therefore has no basis to be completed against.
Fields
reason: OrphanReasonWhy the run cannot be reassembled.
Empty
No partials at all.
Implementations§
Source§impl Reassembly
impl Reassembly
Sourcepub const fn is_complete(&self) -> bool
pub const fn is_complete(&self) -> bool
true when the run is whole and may be billed.
Sourcepub const fn may_still_complete(&self) -> bool
pub const fn may_still_complete(&self) -> bool
true when more records may still arrive to finish the run.
An orphan cannot be finished by waiting: what is missing is the basis the run needed to be readable at all.
Sourcepub fn missing(&self) -> &[u32]
pub fn missing(&self) -> &[u32]
The sequence numbers still outstanding, up to
PartialRun::MAX_REPORTED_MISSING of them.
Sourcepub const fn missing_count(&self) -> u64
pub const fn missing_count(&self) -> u64
How many sequence numbers are outstanding, exactly.
Always the true figure, even where missing was
truncated.
Sourcepub fn missing_is_truncated(&self) -> bool
pub fn missing_is_truncated(&self) -> bool
true when missing lists fewer holes than there are.