Struct mentat::Schema [] [src]

pub struct Schema {
    pub entid_map: BTreeMap<i64, Keyword>,
    pub ident_map: BTreeMap<Keyword, i64>,
    pub attribute_map: BTreeMap<i64, Attribute>,
    pub component_attributes: Vec<i64>,
}

Represents a Mentat schema.

Maintains the mapping between string idents and positive integer entids; and exposes the schema flags associated to a given entid (equivalently, ident).

TODO: consider a single bi-directional map instead of separate ident->entid and entid->ident maps.

Fields

Map entid->ident.

Invariant: is the inverse map of ident_map.

Map ident->entid.

Invariant: is the inverse map of entid_map.

Map entid->attribute flags.

Invariant: key-set is the same as the key-set of entid_map (equivalently, the value-set of ident_map).

Maintain a vec of unique attribute IDs for which the corresponding attribute in attribute_map has .component == true.

Methods

impl Schema
[src]

Returns an symbolic representation of the schema suitable for applying across Mentat stores.

Trait Implementations

impl Default for Schema
[src]

Returns the "default value" for a type. Read more

impl PartialOrd<Schema> for Schema
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Clone for Schema
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Ord for Schema
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Hash for Schema
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Eq for Schema
[src]

impl PartialEq<Schema> for Schema
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl HasSchema for Schema
[src]

Return true if the provided entid identifies an attribute in this schema.

Return true if the provided ident identifies an attribute in this schema.

Important traits for &'a [u8]

impl Debug for Schema
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Schema

impl Sync for Schema