pub enum AdapterError {
NotWellFormed {
field: &'static str,
},
Hole {
field: &'static str,
count: usize,
},
}Expand description
Why an entity could not be converted.
Variants§
NotWellFormed
A string in the projection is not well-formed Unicode — it holds an
unpaired surrogate, so it has no Rust &str form and no NFC form
either.
Refused rather than coerced. The lossy conversion would map every unpaired surrogate to the replacement character, collapsing strings that are genuinely distinct into one node — which is the defect class the diff engine’s own UTF-16 work exists to prevent. A caller that meets this has malformed input and should hear about it.
Hole
The projection carries an array hole — an absent index — and the node encoding has no form for one.
Refused rather than skipped, because a hole is content: the diff
engine counts holes in SparseCollection precisely so that a 2-member
set with a gap is not equal to a 2-member set without one (#8042,
#8114). Iterating only the present records would give both the same
node address, which is a silent collision in the one layer whose whole
job is that addresses separate what differs.
Representing them is a canonical-encoding change, and index §6.1 holds that question open, so this refuses and says why instead of inventing an encoding here.
Trait Implementations§
Source§impl Clone for AdapterError
impl Clone for AdapterError
Source§fn clone(&self) -> AdapterError
fn clone(&self) -> AdapterError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more