pub struct Loss(/* private fields */);Expand description
The markdown-projection loss class of an island: a description of how
faithfully the projection carries it, for a consumer to surface (a caller
warned that a form field silently dropped a table). It is not a
switch: crate::export::to_markdown dispatches on
Island::island_type, never on this.
Open on Island::island_type’s terms: the wire string is the stored
value, and Fidelity is the closed view over it. A class this build lacks
is carried verbatim, so a reader that merely opens a document does not move
its content hash (DOCUMENT_STORAGE.md § Byte-stability).
One value per wire string, so the encoding is injective: a built-in’s name
spells that built-in and nothing else, and the reserved-name rule the
payload-carrying axes need (Invariant::ReservedUnknownTag and its two
siblings) has nothing to guard here.
Read fidelity through Loss::fidelity, never by comparing against
Loss::LOSSLESS: an uninterpretable class degrades to
Fidelity::Unrepresentable, so nothing is claimed to carry faithfully on
the strength of a name this build cannot read.
Implementations§
Source§impl Loss
impl Loss
Sourcepub const DEGRADED: Loss
pub const DEGRADED: Loss
Markdown carries an approximation (round-trips visibly, not identically).
Sourcepub const UNREPRESENTABLE: Loss
pub const UNREPRESENTABLE: Loss
No markdown encoding: what an island type with no projection carries.
Sourcepub fn new(class: &str) -> Loss
pub fn new(class: &str) -> Loss
Wrap a wire class. Every string is a class, uninterpretable ones included;
Loss::fidelity is where that is resolved.
An interpretable class borrows its 'static spelling, so decoding an
island allocates only for the uninterpretable. Equality is by name either
way, so Loss::new("lossless") == Loss::LOSSLESS.
Trait Implementations§
impl Eq for Loss
impl StructuralPartialEq for Loss
Auto Trait Implementations§
impl Freeze for Loss
impl RefUnwindSafe for Loss
impl Send for Loss
impl Sync for Loss
impl Unpin for Loss
impl UnsafeUnpin for Loss
impl UnwindSafe for Loss
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.