Skip to main content

BoundValueKind

Struct BoundValueKind 

Source
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

Source

pub fn unbound(value: ValueKind) -> Self

Source

pub fn with_binding(value: ValueKind, unit: Option<Arc<str>>) -> Self

Source

pub fn with_instance_factors( value: ValueKind, unit: Option<Arc<str>>, instance_factors: Option<Arc<InstanceFactors>>, ) -> Self

Source

pub fn to_literal(&self) -> LiteralValue

Source

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.

Source

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).

Source

pub fn binding_with_agreed_factors( unit: Option<Arc<str>>, factors: &Option<Arc<InstanceFactors>>, ) -> Option<Arc<str>>

Keep a written unit only when agreed instance factors still know its factor. When there is no instance map, leave the binding for plan-scoped runtime scales.

Trait Implementations§

Source§

impl Clone for BoundValueKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BoundValueKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for BoundValueKind

Source§

impl Hash for BoundValueKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for BoundValueKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BoundValueKind

Auto Trait Implementations§

§

impl Forget for BoundValueKind

§

impl Freeze for BoundValueKind
where *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
where RawVecInner: Send, Arc<str>: Send, BoxRaw<TypedLiteral>: Send, Arc<RowInstance>: Send, BoxRaw<InstanceKey>: Send, Arc<[TypedLiteral]>: Send, Arc<RowStore>: Send, Arc<LemmaType>: Send, Arc<KeyIndex>: Send, Arc<InstanceFactors>: Send,

§

impl Sync for BoundValueKind
where RawVecInner: Sync, Arc<str>: Sync, BoxRaw<TypedLiteral>: Sync, Arc<RowInstance>: Sync, BoxRaw<InstanceKey>: Sync, Arc<[TypedLiteral]>: Sync, Arc<RowStore>: Sync, Arc<LemmaType>: Sync, Arc<KeyIndex>: Sync, Arc<InstanceFactors>: Sync,

§

impl Unpin for BoundValueKind
where *const u8 is !null: Unpin, Arc<str>: Unpin, Box<TypedLiteral>: Unpin, Arc<RowInstance>: Unpin, Box<InstanceKey>: Unpin, Arc<[TypedLiteral]>: Unpin, Arc<RowStore>: Unpin, Arc<LemmaType>: Unpin, Arc<KeyIndex>: Unpin, Arc<InstanceFactors>: Unpin,

§

impl UnsafeUnpin for BoundValueKind
where *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 BoundValueKind
where 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.