MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / kind

Method kind

crates/primitives/src/attr.rs:127–139  ·  view source on GitHub ↗

Returns the [ColumnAttribute] of constraints as an enum variant. NOTE: This represent the higher possible representation of a constraints, so for example `IDENTITY` imply that is `INDEXED, UNIQUE`

(&self)

Source from the content-addressed store, hash-verified

125 /// NOTE: This represent the higher possible representation of a constraints, so for example
126 /// `IDENTITY` imply that is `INDEXED, UNIQUE`
127 pub fn kind(&self) -> AttributeKind {
128 match *self {
129 x if x == Self::UNSET => AttributeKind::UNSET,
130 x if x == Self::INDEXED => AttributeKind::INDEXED,
131 x if x == Self::UNIQUE => AttributeKind::UNIQUE,
132 x if x == Self::AUTO_INC => AttributeKind::AUTO_INC,
133 x if x == Self::IDENTITY => AttributeKind::IDENTITY,
134 x if x == Self::PRIMARY_KEY => AttributeKind::PRIMARY_KEY,
135 x if x == Self::PRIMARY_KEY_AUTO => AttributeKind::PRIMARY_KEY_AUTO,
136 x if x == Self::PRIMARY_KEY_IDENTITY => AttributeKind::PRIMARY_KEY_IDENTITY,
137 x => unreachable!("Unexpected value {x:?}"),
138 }
139 }
140}
141
142/// Represents constraints for a database table. May apply to multiple columns.

Callers 7

lock_innerMethod · 0.45
newMethod · 0.45
pid_fileMethod · 0.45
current_versionMethod · 0.45
execMethod · 0.45
try_fromMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected