pub enum TypeFidelity {
Exact,
Compatible,
LogicalString,
Lossy,
Unsupported,
}Expand description
Fidelity tag attached to every crate::types::TypeMapping.
The variants are deliberately ordered from “best” to “worst” so that
downstream code (CLI report, strict-mode gate) can compare them with
PartialOrd semantics:
Exact > Compatible > LogicalString > Lossy > Unsupported.
Variants§
Exact
Value and type semantics fully preserved on disk.
Compatible
Value preserved; physical type differs, logical-type metadata recovers the original semantics.
LogicalString
Value preserved as text; native type semantics are not guaranteed.
Lossy
Precision or semantics may be lost. Strict mode rejects this.
Unsupported
Rivet does not safely support this type. Strict mode rejects this.
Implementations§
Source§impl TypeFidelity
impl TypeFidelity
Sourcepub fn label(self) -> &'static str
pub fn label(self) -> &'static str
Stable lowercase string label for persistence, JSON output, and
human-readable reports. Prefer this over format!("{:?}") —
Debug output is not a stable contract.
Sourcepub fn is_unsafe_for_strict_mode(self) -> bool
pub fn is_unsafe_for_strict_mode(self) -> bool
True when the fidelity level is one that strict mode must reject without an explicit policy override (roadmap §7 “Strict mode behavior”). Used by TypePolicy (Chunk 4).
Trait Implementations§
Source§impl Clone for TypeFidelity
impl Clone for TypeFidelity
Source§fn clone(&self) -> TypeFidelity
fn clone(&self) -> TypeFidelity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TypeFidelity
impl Debug for TypeFidelity
Source§impl Hash for TypeFidelity
impl Hash for TypeFidelity
Source§impl Ord for TypeFidelity
impl Ord for TypeFidelity
Source§fn cmp(&self, other: &TypeFidelity) -> Ordering
fn cmp(&self, other: &TypeFidelity) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TypeFidelity
impl PartialEq for TypeFidelity
Source§fn eq(&self, other: &TypeFidelity) -> bool
fn eq(&self, other: &TypeFidelity) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TypeFidelity
impl PartialOrd for TypeFidelity
Source§impl Serialize for TypeFidelity
impl Serialize for TypeFidelity
impl Copy for TypeFidelity
impl Eq for TypeFidelity
impl StructuralPartialEq for TypeFidelity
Auto Trait Implementations§
impl Freeze for TypeFidelity
impl RefUnwindSafe for TypeFidelity
impl Send for TypeFidelity
impl Sync for TypeFidelity
impl Unpin for TypeFidelity
impl UnsafeUnpin for TypeFidelity
impl UnwindSafe for TypeFidelity
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.