pub trait Entity {
type Relations: Relation;
type Id: FromStr + Into<String>;
// Required method
fn object_type() -> &'static str;
}
Expand description
An entity is any object in your SpiceDB system
The Id type represents whatever rust type you’re using internally, since SpiceDB only uses
Strings to avoid having to convert and deal with errors everywhere we use trait bounds FromStr
and Into<String>
which a lot of common Id types like Uuid
or u32
already implement.
Required Associated Types§
Required Methods§
fn object_type() -> &'static str
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.