Struct mentat_core::Schema [] [src]

pub struct Schema {
    pub entid_map: EntidMap,
    pub ident_map: IdentMap,
    pub attribute_map: AttributeMap,
    pub component_attributes: Vec<Entid>,
}

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]

[src]

[src]

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

[src]

Trait Implementations

impl Clone for Schema
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Schema
[src]

[src]

Formats the value using the given formatter. Read more

impl Default for Schema
[src]

[src]

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

impl Eq for Schema
[src]

impl Hash for Schema
[src]

[src]

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

1.3.0
[src]

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

impl Ord for Schema
[src]

[src]

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

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialOrd for Schema
[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

impl PartialEq for Schema
[src]

[src]

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

[src]

This method tests for !=.

impl HasSchema for Schema
[src]

[src]

[src]

[src]

[src]

[src]

[src]

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

[src]

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

Important traits for &'a [u8]
[src]