danmossa/spacetimedb-skills

spacetimedb-client-rust

Use when writing SpacetimeDB Rust clients, generated Rust bindings, connection code, subscriptions, cache access, reducer invocation, callbacks, or identity handling.

First seen May 7, 2026

Installation

$ npx skills add danmossa/spacetimedb-skills --skill spacetimedb-client-rust

Summary

  • Use when writing SpacetimeDB Rust clients, generated Rust bindings, connection code, subscriptions, cache access, reducer invocation, callbacks, or identity handling.
  • Triggers on: Rust client, Rust SDK, generated Rust bindings, Rust subscription, Rust reducer call, Rust callbacks.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from danmossa/spacetimedb-skills · top by installs.

npx skills add danmossa/spacetimedb-skills

Browse all from danmossa/spacetimedb-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 19
License MIT
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,203 B
  • docs SUMMARY.md 312 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 38 installs

SKILL.md

Use this skill for Rust client implementation.

Core Rust patterns

Generate Rust bindings and import generated names from the local module:

spacetime generate --lang rust --out-dir client/src/module_bindings --module-path spacetimedb
use module_bindings::DbConnection;

let conn = DbConnection::builder()
    .with_uri("ws://localhost:3000")
    .with_database_name("my-database")
    .on_connect(|ctx, identity, _token| {
        log::info!("connected: {identity}");
        ctx.subscription_builder().subscribe_to_all_tables();
    })
    .on_connect_error(|_ctx, err| log::error!("connect error: {err}"))
    .on_disconnect(|_ctx, err| log::info!("disconnected: {err:?}"))
    .build()?;

conn.run_threaded();

Runtime rules

  • Advance the connection with runthreaded, runasync, or frame_tick; callbacks and cache updates require one of these.
  • Read subscribed rows through conn.db.<table>().iter(), .count(), and generated unique/index handles.
  • Register oninsert, ondelete, and onupdate callbacks on generated table handles; onupdate requires a primary key.
  • Use conn.reducers.<reducer>(...) or ctx.reducers() in trait-generic callback contexts.
  • Keep generated binding module names and feature flags aligned with the local project.

Reference map

Need Open
Rust SDK API [references/clients-rust.md](references/clients-rust.md)

Guidance

  • Match generated module names and binding paths from the local project.
  • Keep connection lifecycle, subscription callbacks, and reducer calls aligned with the Rust SDK reference.
  • Route Rust server module schema or reducer code to table and reducer skills rather than this client skill.