Rust SDK
pore-sdk is the official Rust client. It shares types with pore-core, so
in-process integrations pay no serialization cost.
Install
Section titled “Install”cargo add pore-sdkConstruct a client
Section titled “Construct a client”use pore_sdk::Pore;
let pore = Pore::builder() .api_key(std::env::var("PORE_API_KEY")?) .build()?;Example
Section titled “Example”use pore_sdk::{GrantInput, CheckInput};
pore.grants_create(GrantInput { subject: "user:alice".parse()?, relation: "owner".parse()?, object: "document:42".parse()?,}).await?;
let result = pore.check(CheckInput { subject: "user:alice".parse()?, relation: "editor".parse()?, object: "document:42".parse()?,}).await?;
assert!(result.authorized);Error handling
Section titled “Error handling”Errors are returned as Result<T, pore_sdk::Error>. Error is a structured
enum; pattern-match on it rather than stringifying.