Struct mentat_core::Attribute
[−]
[src]
A Mentat schema attribute has a value type and several other flags determining how assertions with the attribute are interpreted.
TODO: consider packing this into a bitfield or similar.
Fields
value_type: ValueType
The associated value type, i.e., :db/valueType
?
multival: bool
true
if this attribute is multi-valued, i.e., it is :db/cardinality :db.cardinality/many
. false
if this attribute is single-valued (the default), i.e., it
is :db/cardinality :db.cardinality/one
.
unique: Option<Unique>
None
if this attribute is neither unique-value nor unique-identity.
Some(attribute::Unique::Value)
if this attribute is unique-value, i.e., it is :db/unique :db.unique/value
.
Unique-value means that there is at most one assertion with the attribute and a particular value in the datom store. Unique-value attributes can be used in lookup-refs.
Some(attribute::Unique::Identity)
if this attribute is unique-identity, i.e., it is :db/unique :db.unique/identity
.
Unique-identity attributes always have value type Ref
.
Unique-identity means that the attribute is unique-value and that they can be used in lookup-refs and will automatically upsert where appropriate.
index: bool
true
if this attribute is automatically indexed, i.e., it is :db/indexing true
.
fulltext: bool
true
if this attribute is automatically fulltext indexed, i.e., it is :db/fulltext true
.
Fulltext attributes always have string values.
component: bool
true
if this attribute is a component, i.e., it is :db/isComponent true
.
Component attributes always have value type Ref
.
They are used to compose entities from component sub-entities: they are fetched recursively by pull expressions, and they are automatically recursively deleted where appropriate.
no_history: bool
true
if this attribute doesn't require history to be kept, i.e., it is :db/noHistory true
.
Methods
impl Attribute
[src]
[−]
impl Attribute
pub fn flags(&self) -> u8
[src]
[−]
pub fn flags(&self) -> u8
Combine several attribute flags into a bitfield used in temporary search tables.
pub fn to_edn_value(&self, ident: Option<Keyword>) -> Value
[src]
pub fn to_edn_value(&self, ident: Option<Keyword>) -> Value
Trait Implementations
impl Clone for Attribute
[src]
[+]
impl Clone for Attribute
impl Debug for Attribute
[src]
[+]
impl Debug for Attribute
impl Eq for Attribute
[src]
impl Eq for Attribute
impl Hash for Attribute
[src]
[+]
impl Hash for Attribute
impl Ord for Attribute
[src]
[+]
impl Ord for Attribute
impl PartialOrd for Attribute
[src]
[+]
impl PartialOrd for Attribute
impl PartialEq for Attribute
[src]
[+]
impl PartialEq for Attribute
impl Default for Attribute
[src]
[+]
impl Default for Attribute