pub struct BoundValueKind {
pub value: ValueKind,
pub unit: Option<Arc<str>>,
pub instance_factors: Option<Arc<InstanceFactors>>,
}Expand description
Canonical suggestion/fill value plus the written measure unit when one was declared.
unit is the unit from -> suggest 100 inr / -> with 5 eur; Show
display stamps it so the one-liner matches the written unit, not the type’s first unit.
Shared via Arc so value-table clones bump a refcount instead of allocating.
For ranges this stays None; each endpoint carries its own unit on its type.
instance_factors are the settled dynamic unit factors of the instance this value
was read from (uses alias or list row). Same-family arithmetic keeps only factors
both sides agree on; a family change drops them.
Fields§
§value: ValueKind§unit: Option<Arc<str>>§instance_factors: Option<Arc<InstanceFactors>>Implementations§
Source§impl BoundValueKind
impl BoundValueKind
pub fn unbound(value: ValueKind) -> Self
pub fn with_binding(value: ValueKind, unit: Option<Arc<str>>) -> Self
pub fn with_instance_factors( value: ValueKind, unit: Option<Arc<str>>, instance_factors: Option<Arc<InstanceFactors>>, ) -> Self
pub fn to_literal(&self) -> LiteralValue
Sourcepub fn agree_or_left_binding(
left: Option<&Arc<str>>,
right: Option<&Arc<str>>,
) -> Option<Arc<str>>
pub fn agree_or_left_binding( left: Option<&Arc<str>>, right: Option<&Arc<str>>, ) -> Option<Arc<str>>
Written-unit agreement for ± on same-family measure/ratio: equal keep; one Some keep that; conflict → left wins.
Sourcepub fn agree_instance_factors(
left: Option<&Arc<InstanceFactors>>,
right: Option<&Arc<InstanceFactors>>,
) -> Option<Arc<InstanceFactors>>
pub fn agree_instance_factors( left: Option<&Arc<InstanceFactors>>, right: Option<&Arc<InstanceFactors>>, ) -> Option<Arc<InstanceFactors>>
Agreed instance factors for same-family arithmetic: units both sides carry with equal factors stay; either side missing a map means no carried instance agreement (local / plan-scoped values rely on runtime scales, not a one-sided carry).
Trait Implementations§
Source§impl Clone for BoundValueKind
impl Clone for BoundValueKind
Source§impl Debug for BoundValueKind
impl Debug for BoundValueKind
impl Eq for BoundValueKind
Source§impl Hash for BoundValueKind
impl Hash for BoundValueKind
Source§impl PartialEq for BoundValueKind
impl PartialEq for BoundValueKind
impl StructuralPartialEq for BoundValueKind
Auto Trait Implementations§
impl Forget for BoundValueKind
impl Freeze for BoundValueKindwhere
*const u8 is !null: Freeze,
PhantomData<u32>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const TypedLiteral is !null: Freeze,
PhantomData<TypedLiteral>: Freeze,
PhantomData<PathSegment>: Freeze,
*const ArcInner<RowInstance> is !null: Freeze,
PhantomData<ArcInner<RowInstance>>: Freeze,
*const InstanceKey is !null: Freeze,
PhantomData<InstanceKey>: Freeze,
*const ArcInner<[TypedLiteral]> is !null: Freeze,
PhantomData<ArcInner<[TypedLiteral]>>: Freeze,
*const ArcInner<RowStore> is !null: Freeze,
PhantomData<ArcInner<RowStore>>: Freeze,
*const ArcInner<LemmaType> is !null: Freeze,
PhantomData<ArcInner<LemmaType>>: Freeze,
*const ArcInner<KeyIndex> is !null: Freeze,
PhantomData<ArcInner<KeyIndex>>: Freeze,
*const ArcInner<InstanceFactors> is !null: Freeze,
PhantomData<ArcInner<InstanceFactors>>: Freeze,
impl Move for BoundValueKind
impl RefUnwindSafe for BoundValueKind
impl Send for BoundValueKind
impl Sync for BoundValueKind
impl Unpin for BoundValueKind
impl UnsafeUnpin for BoundValueKindwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const TypedLiteral is !null: UnsafeUnpin,
PhantomData<TypedLiteral>: UnsafeUnpin,
PhantomData<PathSegment>: UnsafeUnpin,
*const ArcInner<RowInstance> is !null: UnsafeUnpin,
PhantomData<ArcInner<RowInstance>>: UnsafeUnpin,
*const InstanceKey is !null: UnsafeUnpin,
PhantomData<InstanceKey>: UnsafeUnpin,
*const ArcInner<[TypedLiteral]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[TypedLiteral]>>: UnsafeUnpin,
*const ArcInner<RowStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<RowStore>>: UnsafeUnpin,
*const ArcInner<LemmaType> is !null: UnsafeUnpin,
PhantomData<ArcInner<LemmaType>>: UnsafeUnpin,
*const ArcInner<KeyIndex> is !null: UnsafeUnpin,
PhantomData<ArcInner<KeyIndex>>: UnsafeUnpin,
*const ArcInner<InstanceFactors> is !null: UnsafeUnpin,
PhantomData<ArcInner<InstanceFactors>>: UnsafeUnpin,
impl UnwindSafe for BoundValueKindwhere
RawVecInner: UnwindSafe,
Arc<str>: UnwindSafe,
BoxRaw<TypedLiteral>: UnwindSafe,
Arc<RowInstance>: UnwindSafe,
BoxRaw<InstanceKey>: UnwindSafe,
Arc<[TypedLiteral]>: UnwindSafe,
Arc<RowStore>: UnwindSafe,
Arc<LemmaType>: UnwindSafe,
Arc<KeyIndex>: UnwindSafe,
Arc<InstanceFactors>: UnwindSafe,
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.