Skip to main content

Crate yeti_types

Crate yeti_types 

Source
Expand description

Yeti Types — Platform vocabulary crate.

Defines the core traits, error types, encoding functions, and schema types that every other Yeti crate depends on. This crate has ZERO dependencies on other yeti crates.

§Exports

  • trait Resource — handle(method, request, params) -> response
  • trait KvBackend — get, put, delete, scan, get_batch
  • enum Access — request authorization decision (closed enum, no dyn dispatch); holds Arc<User> when authenticated
  • trait AuthProviderauthenticate(request) -> Option<AuthIdentity>
  • trait Plugin — plugin lifecycle (register, on_ready, on_shutdown)
  • trait RequestMiddleware — request augmentation before handlers
  • struct Context — request context (auth, table context, permission)
  • struct TablePermission — Public | FullAccess | AttributeRestricted
  • struct TableDefinition — schema-parsed table definition
  • struct YetiError / type Result<T> — error handling
  • fn encode(T) -> Vec<u8> / fn decode(bytes) -> T — storage encoding

Modules§

app_snapshot
Process-wide snapshot of registered applications. Written once by yeti-host at startup-complete; read by tooling crates that need the app list but can’t depend on yeti-host (eg yeti-mcp-domain’s app_list tool). Process-wide snapshot of registered applications.
auth
Authentication and access control traits. Authentication and authorization framework types.
backend
Storage backend traits and types. Storage backend traits and types.
content_type
Content type enum and format resolution. Content type enum and format resolution.
deployment
Canonical deployment address derivation — the stable, app-independent deployment_hash (sha256(customer|environment)[..16]). Canonical deployment address derivation.
encoding
Storage encoding (MessagePack serialize/deserialize, KeyEncoder trait). Storage encoding — serialize/deserialize values for storage.
error
Error types and result aliases. Domain-specific error types for the Yeti platform.
fairness
Weighted fair scheduling across tenants (anti-starvation). Weighted fair scheduling across tenants.
hlc
Hybrid Logical Clock — replication-timestamp primitive. Stamped on every entry in the per-deployment transaction log and consulted for the per-record __hlc_meta sidecar . Configurable skew tolerance via yeti-config.yaml (replication.hlc_skew_tolerance_ms). Hybrid Logical Clock (HLC) — replication timestamp primitive.
hooks
Resource execution hooks (pre/post/failure). Resource execution hooks — pre/post/failure hooks for request dispatch.
inventory
Process-wide deployment inventory — databases, apps, tables, interfaces, functions. Written once by yeti-host at startup-complete; read by yeti-mcp’s inventory_full / inventory_summary tools so MCP-attached agents get the whole deployment shape in one call. Process-wide deployment inventory.
node
Canonical node identity ({provider}-{region}-{node}-{hash}-{count}). Canonical node identity.
platform
Platform utilities (telemetry events, path helpers). Platform utilities — path helpers + MQTT interface config.
plugins
Plugin traits, registration context, and the extension contracts (tower::Service<R> for every plugin surface — see ADR-006). Strongly-typed Request / Response types per domain (request, lifecycle, auth, token, oauth, queue, mcp) live in submodules. Plugin traits and registration context.
pubsub
PubSub (topic-based publish/subscribe). PubSub — topic-based publish/subscribe system.
queue
Durable work queue types. Durable work queue — types shared across host components and the SDK.
resource
Resource trait and supporting types. Resource trait and Context — the v2 request pipeline.
safety
Deployment-safety declarations. Deployment-safety declarations for toggleable internal crates.
scalar
Canonical GraphQL scalar registry (name → JSON type + WIT type). Canonical GraphQL scalar registry — the single source of truth for how each scalar maps to a JSON-schema type and a WIT type.
schema
Schema types (TableDefinition, FieldDefinition, PublicAccess). Schema types for Yeti table definitions.
secrets
Pluggable secrets backend interface — ADR-014 §5. Pluggable secrets backend interface — ADR-014 §5.
ssl_cert
Custom-domain TLS cert install seam (SslCertInstaller). The wasm host holds an Arc<dyn SslCertInstaller>; the concrete impl lives in yeti-cluster and is wired in at startup, keeping the runtime crate free of a cluster dependency. Custom-domain TLS cert install seam — the lowest shared declaration.
transcode
Zero-Value MessagePack → JSON transcoding for the read path. Zero-Value MessagePack → JSON transcoding for the read path.
transport
Canonical transport identity (Transport, TransportSet). Canonical transport identity — the single source of truth for the set of interfaces a table can expose and a request can arrive on.
types
Common type aliases and newtypes. Common type aliases and newtypes used throughout the platform.