docs.rs failed to build spicedb-embedded-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
spicedb-embedded (Rust)
Embedded SpiceDB for Rust — authorization server for tests and development. Uses the shared/c C library via FFI and connects over gRPC via Unix sockets or TCP. Supports memory (default), postgres, cockroachdb, spanner, and mysql datastores.
Installation
Add to your Cargo.toml:
[]
= { = "../spicedb-embedded/rust" }
# Or from crates.io when published:
# spicedb-embedded = "0.1"
Prerequisites: Go 1.23+ with CGO enabled (to build the shared library). The Rust build script compiles the C library from Go source at build time; the crate does not ship prebuilt .so/.dll/.dylib binaries, so it stays portable across platforms.
Usage
use ;
let schema = r#"
definition user {}
definition document {
relation reader: user
permission read = reader
}
"#;
let relationships = vec!;
let spicedb = new.await?;
// Check permission
let response = spicedb
.permissions
.check_permission
.await?;
let allowed = response.into_inner.permissionship
== HasPermission as i32;
API
EmbeddedSpiceDB::new(schema, relationships)— Create an instance with schema and optional initial relationships.EmbeddedSpiceDB::new_with_options(schema, relationships, options)— Create withStartOptions(datastore,grpc_transport, etc.). PassNonefor defaults.permissions()—PermissionsServiceClientfor CheckPermission, WriteRelationships, ReadRelationships, etc.schema()—SchemaServiceClientfor ReadSchema, WriteSchema, ReflectSchema, etc.watch()—WatchServiceClientfor watching relationship changes.
All types are re-exported from spicedb_grpc::authzed::api::v1 as spicedb_embedded::v1.
StartOptions
use ;
let options = StartOptions ;
let spicedb = new_with_options.await?;
Building & Testing
Or from the repo root: mise run check