Skip to main content

UnitIndex

Struct UnitIndex 

Source
pub struct UnitIndex { /* private fields */ }
Expand description

Expression-scope units after bind: every declarer per bare unit name.

Implementations§

Source§

impl UnitIndex

Source

pub fn new() -> Self

Source

pub fn unique_owner(&self, bare: &str) -> Option<&Arc<LemmaType>>

Source

pub fn owners_for(&self, bare: &str) -> &[UnitOwner]

Source

pub fn iter_entries(&self) -> impl Iterator<Item = (&str, &Arc<LemmaType>)>

Source

pub fn iter_owners(&self) -> impl Iterator<Item = (&str, &UnitOwner)>

Source

pub fn values(&self) -> impl Iterator<Item = &Arc<LemmaType>>

Source

pub fn family_root(&self, family: &TypeFamily) -> Option<&Arc<LemmaType>>

Family-root type for family, keyed by full TypeFamily identity.

Source

pub fn keys(&self) -> impl Iterator<Item = &String>

Source

pub fn insert_owner(&mut self, bare: String, owner: UnitOwner)

Source

pub fn insert_list_row_owner(&mut self, bare: String, owner: UnitOwner)

See [PlanningUnitIndex::insert_list_row_owner].

Source

pub fn resolve( &self, unit_ref: &str, ) -> Result<(String, Arc<LemmaType>), String>

Source

pub fn instance_routes(&self, bare: &str) -> Vec<(String, &UnitOwner)>

One alias.Type.unit route per instance that declares the bare unit bare, with its owner, in route order. Empty when bare names at most one instance.

Source

pub fn resolve_owner( &self, unit_ref: &str, ) -> Result<(String, &UnitOwner), String>

Source

pub fn resolve_via_named_measure_type( unit_ref: &str, resolved: &IndexMap<String, Arc<LemmaType>>, ) -> Option<(String, Arc<LemmaType>)>

Source

pub fn resolve_with_named_types( &self, unit_ref: &str, resolved: &IndexMap<String, Arc<LemmaType>>, ) -> Result<(String, Arc<LemmaType>), String>

Source

pub fn owning_type_for_signature_factor<'a>( &'a self, unit_name: &str, typed_owners: &[&'a LemmaType], ) -> Option<&'a LemmaType>

Trait Implementations§

Source§

impl Clone for UnitIndex

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 UnitIndex

Source§

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

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

impl Default for UnitIndex

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for UnitIndex

§

impl Freeze for UnitIndex
where *const u8 is !null: Freeze, PhantomData<usize>: Freeze, PhantomData<Bucket<String, Vec<UnitOwner>>>: Freeze, PhantomData<Bucket<(String, Option<(Vec<String>, String)>), usize>>: Freeze, PhantomData<Bucket<(Vec<String>, String), Arc<LemmaType>>>: Freeze, *const LeafNode<TypeFamily, Arc<LemmaType>> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(TypeFamily, Arc<LemmaType>)>>: Freeze,

§

impl Move for UnitIndex

§

impl RefUnwindSafe for UnitIndex

§

impl Send for UnitIndex
where RawTable<usize>: Send, RawVecInner: Send, Arc<LemmaType>: Send, NodeRef<Owned, TypeFamily, Arc<LemmaType>, LeafOrInternal>: Send, BoxRaw<(TypeFamily, Arc<LemmaType>)>: Send,

§

impl Sync for UnitIndex
where RawTable<usize>: Sync, RawVecInner: Sync, Arc<LemmaType>: Sync, NodeRef<Owned, TypeFamily, Arc<LemmaType>, LeafOrInternal>: Sync, BoxRaw<(TypeFamily, Arc<LemmaType>)>: Sync,

§

impl Unpin for UnitIndex

§

impl UnsafeUnpin for UnitIndex

§

impl UnwindSafe for UnitIndex

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