@crowdedkingdoms/crowdyjs 18.10.0 → 18.11.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +43 -0
- package/README.md +79 -30
- package/dist/crowdy-client.d.ts +11 -3
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +25 -4
- package/dist/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/domains/exec.d.ts +6 -0
- package/dist/domains/exec.d.ts.map +1 -1
- package/dist/domains/exec.js +28 -2
- package/dist/generated/graphql-schema.d.ts +1 -1
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/kit/index.d.ts +13 -2
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +13 -2
- package/dist/kit/kit.d.ts +83 -7
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +82 -4
- package/dist/kit/mirror.d.ts +111 -0
- package/dist/kit/mirror.d.ts.map +1 -0
- package/dist/kit/mirror.js +295 -0
- package/dist/kit/modules/matchmaking.d.ts +107 -0
- package/dist/kit/modules/matchmaking.d.ts.map +1 -0
- package/dist/kit/modules/matchmaking.js +109 -0
- package/dist/kit/modules/npcs.d.ts +80 -0
- package/dist/kit/modules/npcs.d.ts.map +1 -0
- package/dist/kit/modules/npcs.js +102 -0
- package/dist/kit/modules/presence.d.ts +81 -0
- package/dist/kit/modules/presence.d.ts.map +1 -0
- package/dist/kit/modules/presence.js +99 -0
- package/dist/kit/modules/sessions.d.ts +91 -0
- package/dist/kit/modules/sessions.d.ts.map +1 -0
- package/dist/kit/modules/sessions.js +84 -0
- package/dist/kit/modules/world.d.ts +69 -0
- package/dist/kit/modules/world.d.ts.map +1 -0
- package/dist/kit/modules/world.js +35 -0
- package/dist/kit/protocol.d.ts +128 -0
- package/dist/kit/protocol.d.ts.map +1 -0
- package/dist/kit/protocol.js +171 -0
- package/dist/kit/realtime.d.ts +72 -0
- package/dist/kit/realtime.d.ts.map +1 -0
- package/dist/kit/realtime.js +108 -0
- package/dist/kit/runtime.d.ts +90 -0
- package/dist/kit/runtime.d.ts.map +1 -0
- package/dist/kit/runtime.js +194 -0
- package/dist/kit/store.d.ts +20 -0
- package/dist/kit/store.d.ts.map +1 -0
- package/dist/kit/store.js +25 -0
- package/dist/kit/topology.d.ts +69 -0
- package/dist/kit/topology.d.ts.map +1 -0
- package/dist/kit/topology.js +156 -0
- package/dist/kit/wire.d.ts +45 -5
- package/dist/kit/wire.d.ts.map +1 -1
- package/dist/kit/wire.js +51 -5
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +1935 -45
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":2,"rustVersion":"1.97.1","sdkVersion":"0.1.0","abiVersion":0,"contentHash":"c219690850999e82f66ce369a7aa13a65b48e3fcd6bfa786f0c05011650ed020","crates":[{"name":"alloc","version":"1.97.1","sourceHash":"7386c02231ab279f515a3768adc6662d2f043ef8ab3a9f88af6b38c1c226a7eb"},{"name":"ckx-sdk","version":"0.7.0","sourceHash":"b4583d898c102c2ff1ea677470cc41b1c72dc49dd5f14c1e9c17d13da1bb0733"},{"name":"core","version":"1.97.1","sourceHash":"7386c02231ab279f515a3768adc6662d2f043ef8ab3a9f88af6b38c1c226a7eb"},{"name":"crowdy-client-sdk","version":"0.1.0","sourceHash":"2d21f7c4f1fee650437edbce435b3c50609be4ee49c646916be504ac2be8f6e9"}],"symbols":[{"module":"alloc","name":"format","kind":"macro","signature":"format!(format_string, ...)","docs":"Creates a formatted String."},{"module":"alloc","name":"vec","kind":"macro","signature":"vec![values...]","docs":"Creates a Vec from values or a repeated value."},{"module":"alloc::boxed","name":"Box","kind":"struct","signature":"pub struct Box<T>","docs":"An owned heap allocation."},{"module":"alloc::string","name":"String","kind":"struct","signature":"pub struct String","docs":"A UTF-8 encoded growable string."},{"module":"alloc::vec","name":"Vec","kind":"struct","signature":"pub struct Vec<T>","docs":"A contiguous growable array."},{"module":"ckx_sdk","name":"Call","kind":"struct","signature":"pub struct Call<'a> { pub caller: Caller, pub method: &'a str, pub payload: &'a [u8], }","docs":"One incoming call."},{"module":"ckx_sdk","name":"Call::caller","kind":"field","signature":"pub caller: Caller","docs":""},{"module":"ckx_sdk","name":"Call::decode","kind":"method","signature":"pub fn decode<T: DeserializeOwned>(&self) -> Result<T>","docs":""},{"module":"ckx_sdk","name":"Call::developer","kind":"method","signature":"pub fn developer(&self) -> Result<u64>","docs":"The calling developer, or an error when the caller is not one: the guard for an admin endpoint."},{"module":"ckx_sdk","name":"Call::method","kind":"field","signature":"pub method: &'a str","docs":""},{"module":"ckx_sdk","name":"Call::payload","kind":"field","signature":"pub payload: &'a [u8]","docs":""},{"module":"ckx_sdk","name":"Call::player","kind":"method","signature":"pub fn player(&self) -> Result<u64>","docs":"The calling player, or an error when the caller is not a player."},{"module":"ckx_sdk","name":"CallError","kind":"struct","signature":"pub struct CallError { pub status: Status, pub message: String, }","docs":"A failed call made by this instance."},{"module":"ckx_sdk","name":"CallError::fmt","kind":"method","signature":"fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result","docs":""},{"module":"ckx_sdk","name":"CallError::message","kind":"field","signature":"pub message: String","docs":""},{"module":"ckx_sdk","name":"CallError::status","kind":"field","signature":"pub status: Status","docs":""},{"module":"ckx_sdk","name":"Caller","kind":"enum","signature":"pub enum Caller { Platform, Instance(u64), Player(u64), /// A developer of the app (the org's `manage_compute`), by user id, connected with /// `execConnectAsDeveloper`: studio tools, manual runs and admin endpoints. It may call any /// type, not only `client` ones, so check for it in handlers only developers should reach. Developer(u64), }","docs":"Who is calling. The platform sets this; a handler can trust it for authorization."},{"module":"ckx_sdk","name":"Caller::Developer","kind":"variant","signature":"Developer(u64)","docs":"A developer of the app (the org's `manage_compute`), by user id, connected with `execConnectAsDeveloper`: studio tools, manual runs and admin endpoints. It may call any type, not only `client` ones, so check for it in handlers only developers should reach."},{"module":"ckx_sdk","name":"Caller::Instance","kind":"variant","signature":"Instance(u64)","docs":""},{"module":"ckx_sdk","name":"Caller::Platform","kind":"variant","signature":"Platform","docs":""},{"module":"ckx_sdk","name":"Caller::Player","kind":"variant","signature":"Player(u64)","docs":""},{"module":"ckx_sdk","name":"Ctx","kind":"struct","signature":"pub struct Ctx { pub app: u64, pub instance: u64, pub epoch: u64, /// The deployed code version. pub version: u64, pub kind: Kind, pub node_type: String, pub key: String, }","docs":"This instance's identity and its way out: calls, messages, publishing and the node API."},{"module":"ckx_sdk","name":"Ctx::app","kind":"field","signature":"pub app: u64","docs":""},{"module":"ckx_sdk","name":"Ctx::call","kind":"method","signature":"pub fn call(&self, node_type: &str, key: &str, method: &str, payload: &[u8]) -> Result<Vec<u8>, CallError>","docs":"Calls an endpoint on another instance of this app and waits for its reply. This instance handles nothing else until the reply arrives or the deadline passes."},{"module":"ckx_sdk","name":"Ctx::call_typed","kind":"method","signature":"pub fn call_typed<Req: Serialize + ?Sized, Resp: DeserializeOwned>( &self, node_type: &str, key: &str, method: &str, req: &Req, ) -> Result<Resp>","docs":"[`Ctx::call`] with MessagePack encoding on both sides."},{"module":"ckx_sdk","name":"Ctx::call_with_deadline","kind":"method","signature":"pub fn call_with_deadline( &self, node_type: &str, key: &str, method: &str, payload: &[u8], deadline_ms: u32, ) -> Result<Vec<u8>, CallError>","docs":""},{"module":"ckx_sdk","name":"Ctx::cancel_timer","kind":"method","signature":"pub fn cancel_timer(&self, name: &str) -> bool","docs":"Cancels a timer. Returns whether it was set."},{"module":"ckx_sdk","name":"Ctx::emit_actor","kind":"method","signature":"pub fn emit_actor(&self, actor: &[u8; 32], at: node::ChunkPos, distance: u8, state: &[u8]) -> Result<(), CallError>","docs":"Shows a server-driven actor (an NPC, a mob) with `state` to the players near `at`."},{"module":"ckx_sdk","name":"Ctx::emit_channel","kind":"method","signature":"pub fn emit_channel(&self, channel: u64, sender: &[u8; 32], payload: &[u8]) -> Result<(), CallError>","docs":"Sends `payload` to every member of one of the app's channels, as a channel message from `sender`."},{"module":"ckx_sdk","name":"Ctx::emit_spatial","kind":"method","signature":"pub fn emit_spatial(&self, at: node::ChunkPos, distance: u8, actor: &[u8; 32], event: emit::Spatial<'_>) -> Result<(), CallError>","docs":"Sends a spatial event to the players within `distance` chunks of `at` (at most 8), at once, through the realtime tier. `actor` is the event's actor: the actor whose state it is, or the one an [`Spatial::ActorMessage`] is for. See [`emit`]."},{"module":"ckx_sdk","name":"Ctx::epoch","kind":"field","signature":"pub epoch: u64","docs":""},{"module":"ckx_sdk","name":"Ctx::grids","kind":"method","signature":"pub fn grids(&self) -> node::Grids<'_>","docs":"This app's grids and their permissions (scope `grids.read`)."},{"module":"ckx_sdk","name":"Ctx::instance","kind":"field","signature":"pub instance: u64","docs":""},{"module":"ckx_sdk","name":"Ctx::key","kind":"field","signature":"pub key: String","docs":""},{"module":"ckx_sdk","name":"Ctx::kind","kind":"field","signature":"pub kind: Kind","docs":""},{"module":"ckx_sdk","name":"Ctx::log","kind":"method","signature":"pub fn log(&self, level: Level, msg: &str)","docs":""},{"module":"ckx_sdk","name":"Ctx::node","kind":"method","signature":"pub fn node(&self, op: &str, payload: &[u8]) -> Result<Vec<u8>, CallError>","docs":"A raw node API request: `op` and a JSON body, answered with JSON. The typed operations behind [`Ctx::world`], [`Ctx::grids`], [`Ctx::players`] and [`Ctx::permissions`] use it."},{"module":"ckx_sdk","name":"Ctx::node_type","kind":"field","signature":"pub node_type: String","docs":""},{"module":"ckx_sdk","name":"Ctx::now_ms","kind":"method","signature":"pub fn now_ms(&self) -> u64","docs":""},{"module":"ckx_sdk","name":"Ctx::permissions","kind":"method","signature":"pub fn permissions(&self) -> node::Permissions<'_>","docs":"Grants and revokes grid permissions (scope `permissions.write`)."},{"module":"ckx_sdk","name":"Ctx::persist_now","kind":"method","signature":"pub fn persist_now(&self)","docs":"Snapshots this hub soon after the current call returns (at most once a second), for a change that should not wait for the snapshot interval."},{"module":"ckx_sdk","name":"Ctx::players","kind":"method","signature":"pub fn players(&self) -> node::Players<'_>","docs":"Players of this app: identity, tier features, group permissions and app state (scopes `players.read`, `players.write`)."},{"module":"ckx_sdk","name":"Ctx::publish","kind":"method","signature":"pub fn publish(&self, topic: &str, payload: &[u8])","docs":"Pushes `payload` to every subscriber of `topic` on this instance."},{"module":"ckx_sdk","name":"Ctx::send","kind":"method","signature":"pub fn send(&self, node_type: &str, key: &str, method: &str, payload: &[u8]) -> Result<(), CallError>","docs":"Sends a one-way message. Delivery is attempted once; there is no reply."},{"module":"ckx_sdk","name":"Ctx::subscribe","kind":"method","signature":"pub fn subscribe(&self, node_type: &str, key: &str, topic: &str) -> Result<(), CallError>","docs":"Subscribes this hub to `topic` on another instance of the app, if the manifest lets this type call that one. Messages arrive at [`Hub::on_topic`]. The subscription is kept in the snapshot and renewed whenever the hub starts again."},{"module":"ckx_sdk","name":"Ctx::timer_after","kind":"method","signature":"pub fn timer_after(&self, name: &str, delay_ms: u64) -> Result<()>","docs":"Runs [`Hub::on_timer`] with `name` once, `delay_ms` from now, replacing any timer of that name. Timers are kept in the snapshot, so they survive stops and moves; they run only while the hub runs, and one that came due meanwhile runs once when it is back."},{"module":"ckx_sdk","name":"Ctx::timer_every","kind":"method","signature":"pub fn timer_every(&self, name: &str, period_ms: u64) -> Result<()>","docs":"Runs [`Hub::on_timer`] with `name` every `period_ms` (at least 10), the first time one period from now. Replaces any timer of that name."},{"module":"ckx_sdk","name":"Ctx::timers","kind":"method","signature":"pub fn timers(&self) -> Vec<(String, u64)>","docs":"Pending timers and when each is next due, in Unix milliseconds."},{"module":"ckx_sdk","name":"Ctx::unsubscribe","kind":"method","signature":"pub fn unsubscribe(&self, node_type: &str, key: &str, topic: &str) -> Result<(), CallError>","docs":""},{"module":"ckx_sdk","name":"Ctx::version","kind":"field","signature":"pub version: u64","docs":"The deployed code version."},{"module":"ckx_sdk","name":"Ctx::world","kind":"method","signature":"pub fn world(&self) -> node::World<'_>","docs":"Chunks, voxels and actors in this app's world (scopes `world.read`, `world.write`)."},{"module":"ckx_sdk","name":"DEFAULT_DEADLINE_MS","kind":"const","signature":"pub const DEFAULT_DEADLINE_MS: u32 = 2_000;","docs":"Default deadline for calls made without one."},{"module":"ckx_sdk","name":"Error","kind":"struct","signature":"pub struct Error(pub String);","docs":"An error a handler returns. The caller receives its message with status `AppError`."},{"module":"ckx_sdk","name":"Error::fmt","kind":"method","signature":"fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result","docs":""},{"module":"ckx_sdk","name":"Error::from","kind":"method","signature":"fn from(e: CallError) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::from","kind":"method","signature":"fn from(s: &str) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::from","kind":"method","signature":"fn from(s: String) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::new","kind":"method","signature":"pub fn new(msg: impl Into<String>) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::unknown_method","kind":"method","signature":"pub fn unknown_method(method: &str) -> Self","docs":""},{"module":"ckx_sdk","name":"Hub","kind":"trait","signature":"pub trait Hub: Sized + 'static","docs":"A stateful node: one instance per key, one handler at a time."},{"module":"ckx_sdk","name":"Hub::evict","kind":"method","signature":"fn evict(&mut self, _ctx: &Ctx)","docs":"Called once before a graceful stop, after the last persist."},{"module":"ckx_sdk","name":"Hub::handle","kind":"method","signature":"fn handle(&mut self, ctx: &Ctx, call: Call<'_>) -> Result<Vec<u8>>;","docs":""},{"module":"ckx_sdk","name":"Hub::load","kind":"method","signature":"fn load(ctx: &Ctx, snapshot: &[u8], from_version: u64) -> Result<Self>;","docs":"An instance restored from its last snapshot, written by code version `from_version`."},{"module":"ckx_sdk","name":"Hub::on_presence","kind":"method","signature":"fn on_presence(&mut self, _ctx: &Ctx, _presence: &Presence) -> Result<()>","docs":"Root hub only: players entered or left the app."},{"module":"ckx_sdk","name":"Hub::on_session","kind":"method","signature":"fn on_session(&mut self, _ctx: &Ctx, _player: u64, _session: Session) -> Result<()>","docs":"A player's connection subscribed to this hub, or left it."},{"module":"ckx_sdk","name":"Hub::on_timer","kind":"method","signature":"fn on_timer(&mut self, _ctx: &Ctx, _timer: &str) -> Result<()>","docs":"A timer set with [`Ctx::timer_after`] or [`Ctx::timer_every`] is due. An error is logged; the timer stays as scheduled."},{"module":"ckx_sdk","name":"Hub::on_topic","kind":"method","signature":"fn on_topic(&mut self, _ctx: &Ctx, _msg: TopicMsg<'_>) -> Result<()>","docs":"A message on a topic this hub watches."},{"module":"ckx_sdk","name":"Hub::on_world","kind":"method","signature":"fn on_world(&mut self, _ctx: &Ctx, _events: &[WorldEvent]) -> Result<()>","docs":"Mods only: things happened in the mod's grid. An actor arriving starts a mod that is not running, and this is its first call after `spawn` or `load`."},{"module":"ckx_sdk","name":"Hub::persist","kind":"method","signature":"fn persist(&mut self, ctx: &Ctx) -> Result<Vec<u8>>;","docs":"The state to snapshot. Called on the snapshot interval, before a move and before a stop."},{"module":"ckx_sdk","name":"Hub::spawn","kind":"method","signature":"fn spawn(ctx: &Ctx, seed: &[u8]) -> Result<Self>;","docs":"A new instance with no snapshot."},{"module":"ckx_sdk","name":"Kind","kind":"enum","signature":"pub enum Kind { Hub, Spoke, }","docs":""},{"module":"ckx_sdk","name":"Kind::Hub","kind":"variant","signature":"Hub","docs":""},{"module":"ckx_sdk","name":"Kind::Spoke","kind":"variant","signature":"Spoke","docs":""},{"module":"ckx_sdk","name":"Level","kind":"enum","signature":"pub enum Level { Error = 0, Warn = 1, Info = 2, Debug = 3, }","docs":""},{"module":"ckx_sdk","name":"Level::Debug","kind":"variant","signature":"Debug = 3","docs":""},{"module":"ckx_sdk","name":"Level::Error","kind":"variant","signature":"Error = 0","docs":""},{"module":"ckx_sdk","name":"Level::Info","kind":"variant","signature":"Info = 2","docs":""},{"module":"ckx_sdk","name":"Level::Warn","kind":"variant","signature":"Warn = 1","docs":""},{"module":"ckx_sdk","name":"Presence","kind":"struct","signature":"pub struct Presence { /// Players in the app now. pub count: u32, #[serde(default)] pub joined: Vec<PresencePlayer>, #[serde(default)] pub left: Vec<PresencePlayer>, }","docs":"Players who entered or left the app since the last event, or a new count, delivered to the root hub. Events can be lost when the root hub moves; `count` is always current."},{"module":"ckx_sdk","name":"Presence::count","kind":"field","signature":"pub count: u32","docs":"Players in the app now."},{"module":"ckx_sdk","name":"Presence::joined","kind":"field","signature":"pub joined: Vec<PresencePlayer>","docs":""},{"module":"ckx_sdk","name":"Presence::left","kind":"field","signature":"pub left: Vec<PresencePlayer>","docs":""},{"module":"ckx_sdk","name":"PresencePlayer","kind":"struct","signature":"pub struct PresencePlayer { pub player: u64, /// The player's avatar in the world, when they have one. #[serde(default)] pub actor: Option<String>, }","docs":""},{"module":"ckx_sdk","name":"PresencePlayer::actor","kind":"field","signature":"pub actor: Option<String>","docs":"The player's avatar in the world, when they have one."},{"module":"ckx_sdk","name":"PresencePlayer::player","kind":"field","signature":"pub player: u64","docs":""},{"module":"ckx_sdk","name":"Result","kind":"type","signature":"pub type Result<T, E = Error> = std::result::Result<T, E>;","docs":""},{"module":"ckx_sdk","name":"Session","kind":"enum","signature":"pub enum Session { Joined, Left, }","docs":"A player's connection subscribing to a hub's first topic, or leaving its last. A player connected twice joins twice."},{"module":"ckx_sdk","name":"Session::Joined","kind":"variant","signature":"Joined","docs":""},{"module":"ckx_sdk","name":"Session::Left","kind":"variant","signature":"Left","docs":""},{"module":"ckx_sdk","name":"Spoke","kind":"trait","signature":"pub trait Spoke: Sized + 'static","docs":"A stateless node. Replicas may run anywhere; keep nothing here you cannot lose."},{"module":"ckx_sdk","name":"Spoke::handle","kind":"method","signature":"fn handle(&mut self, ctx: &Ctx, call: Call<'_>) -> Result<Vec<u8>>;","docs":""},{"module":"ckx_sdk","name":"Spoke::start","kind":"method","signature":"fn start(ctx: &Ctx) -> Result<Self>;","docs":""},{"module":"ckx_sdk","name":"Status","kind":"enum","signature":"pub enum Status { Ok, AppError, Busy, Moved, NotFound, DeadlineExceeded, Denied, RateLimited, Unavailable, Internal, Trapped, BadRequest, Unknown(u8), }","docs":"The platform's status for a call this instance made. Mirrors the wire status codes."},{"module":"ckx_sdk","name":"Status::AppError","kind":"variant","signature":"AppError","docs":""},{"module":"ckx_sdk","name":"Status::BadRequest","kind":"variant","signature":"BadRequest","docs":""},{"module":"ckx_sdk","name":"Status::Busy","kind":"variant","signature":"Busy","docs":""},{"module":"ckx_sdk","name":"Status::DeadlineExceeded","kind":"variant","signature":"DeadlineExceeded","docs":""},{"module":"ckx_sdk","name":"Status::Denied","kind":"variant","signature":"Denied","docs":""},{"module":"ckx_sdk","name":"Status::Internal","kind":"variant","signature":"Internal","docs":""},{"module":"ckx_sdk","name":"Status::Moved","kind":"variant","signature":"Moved","docs":""},{"module":"ckx_sdk","name":"Status::NotFound","kind":"variant","signature":"NotFound","docs":""},{"module":"ckx_sdk","name":"Status::Ok","kind":"variant","signature":"Ok","docs":""},{"module":"ckx_sdk","name":"Status::RateLimited","kind":"variant","signature":"RateLimited","docs":""},{"module":"ckx_sdk","name":"Status::Trapped","kind":"variant","signature":"Trapped","docs":""},{"module":"ckx_sdk","name":"Status::Unavailable","kind":"variant","signature":"Unavailable","docs":""},{"module":"ckx_sdk","name":"Status::Unknown","kind":"variant","signature":"Unknown(u8)","docs":""},{"module":"ckx_sdk","name":"Status::from_u8","kind":"method","signature":"pub fn from_u8(v: u8) -> Self","docs":""},{"module":"ckx_sdk","name":"Status::is_retryable","kind":"method","signature":"pub fn is_retryable(self) -> bool","docs":""},{"module":"ckx_sdk","name":"TopicMsg","kind":"struct","signature":"pub struct TopicMsg<'a> { /// The publishing instance's type and key. pub node_type: &'a str, pub key: &'a str, pub topic: &'a str, pub payload: &'a [u8], }","docs":"A message published on a topic this hub watches ([`Ctx::subscribe`])."},{"module":"ckx_sdk","name":"TopicMsg::decode","kind":"method","signature":"pub fn decode<T: DeserializeOwned>(&self) -> Result<T>","docs":""},{"module":"ckx_sdk","name":"TopicMsg::key","kind":"field","signature":"pub key: &'a str","docs":""},{"module":"ckx_sdk","name":"TopicMsg::node_type","kind":"field","signature":"pub node_type: &'a str","docs":"The publishing instance's type and key."},{"module":"ckx_sdk","name":"TopicMsg::payload","kind":"field","signature":"pub payload: &'a [u8]","docs":""},{"module":"ckx_sdk","name":"TopicMsg::topic","kind":"field","signature":"pub topic: &'a str","docs":""},{"module":"ckx_sdk","name":"WorldEvent","kind":"struct","signature":"pub struct WorldEvent { pub grid: u64, /// [`WorldEvent::ACTORS`] or [`WorldEvent::VOXELS`]. pub kind: String, pub chunk: [i64; 3], }","docs":"Something that happened in a mod's grid, delivered to mods only. Events come in batches and can be lost; each names the chunk it happened in."},{"module":"ckx_sdk","name":"WorldEvent::ACTORS","kind":"const","signature":"pub const ACTORS: &'static str = \"actors\";","docs":"Actors moved into or out of the chunk."},{"module":"ckx_sdk","name":"WorldEvent::VOXELS","kind":"const","signature":"pub const VOXELS: &'static str = \"voxels\";","docs":"Voxels in the chunk changed."},{"module":"ckx_sdk","name":"WorldEvent::chunk","kind":"field","signature":"pub chunk: [i64; 3]","docs":""},{"module":"ckx_sdk","name":"WorldEvent::grid","kind":"field","signature":"pub grid: u64","docs":""},{"module":"ckx_sdk","name":"WorldEvent::kind","kind":"field","signature":"pub kind: String","docs":"[`WorldEvent::ACTORS`] or [`WorldEvent::VOXELS`]."},{"module":"ckx_sdk","name":"cron","kind":"module","signature":"pub mod cron;","docs":""},{"module":"ckx_sdk","name":"decode","kind":"function","signature":"pub fn decode<T: DeserializeOwned>(bytes: &[u8]) -> Result<T>","docs":"Decodes MessagePack."},{"module":"ckx_sdk","name":"emit","kind":"module","signature":"pub mod emit;","docs":""},{"module":"ckx_sdk","name":"encode","kind":"function","signature":"pub fn encode<T: Serialize + ?Sized>(value: &T) -> Result<Vec<u8>>","docs":"Encodes a value as MessagePack with named fields."},{"module":"ckx_sdk","name":"export_hub","kind":"macro","signature":"macro_rules! export_hub { ($t:ty) => { $crate::__export_node!($crate::rt::HubNode<$t>); }; }","docs":"Exports a [`Hub`] type as this module's node."},{"module":"ckx_sdk","name":"export_spoke","kind":"macro","signature":"macro_rules! export_spoke { ($t:ty) => { $crate::__export_node!($crate::rt::SpokeNode<$t>); }; }","docs":"Exports a [`Spoke`] type as this module's node."},{"module":"ckx_sdk","name":"model","kind":"module","signature":"pub mod model;","docs":""},{"module":"ckx_sdk","name":"node","kind":"module","signature":"pub mod node;","docs":""},{"module":"ckx_sdk","name":"prelude","kind":"module","signature":"pub mod prelude","docs":""},{"module":"ckx_sdk::cron","name":"Cron","kind":"struct","signature":"pub struct Cron { source: String, seconds: u64, minutes: u64, hours: u32, /// Days of the month, bits 1-31. days: u32, /// `L` in the day of month. last_day: bool, /// Entries in the day-of-month field as legacy counted them, which decides whether it is /// unrestricted. day_entries: usize, /// Months, bits 1-12. months: u16, /// Days of the week, bits 0-6 (Sunday 0). weekdays: u8, /// `nL`: the last such weekday of the month. last_weekdays: u8, weekday_entries: usize, /// `n#k`: only the k-th week of the month (days 7k-6 to 7k); 0 when not given. nth: u8, /// Seconds east of UTC. offset_s: i64, }","docs":"A parsed cron expression. See the [module docs](self) for the syntax."},{"module":"ckx_sdk::cron","name":"Cron::Err","kind":"type","signature":"type Err = CronError;","docs":""},{"module":"ckx_sdk::cron","name":"Cron::fmt","kind":"method","signature":"fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result","docs":""},{"module":"ckx_sdk::cron","name":"Cron::from_str","kind":"method","signature":"fn from_str(s: &str) -> Result<Self, CronError>","docs":""},{"module":"ckx_sdk::cron","name":"Cron::next_after","kind":"method","signature":"pub fn next_after(&self, after_ms: u64) -> Option<u64>","docs":"The first time it fires strictly after `after_ms` (Unix milliseconds), on a whole second; `None` when it never does."},{"module":"ckx_sdk::cron","name":"Cron::parse","kind":"method","signature":"pub fn parse(expr: &str) -> Result<Self, CronError>","docs":"Parses an expression; see the [module docs](self) for what is accepted."},{"module":"ckx_sdk::cron","name":"Cron::with_utc_offset","kind":"method","signature":"pub fn with_utc_offset(mut self, minutes: i32) -> Result<Self, CronError>","docs":"The same schedule in a fixed offset from UTC, in minutes east (`-300` for UTC-5), within ±18 hours. There is no daylight saving: a zone that has it needs a new offset when its clocks change."},{"module":"ckx_sdk::cron","name":"CronError","kind":"struct","signature":"pub struct CronError(pub String);","docs":"Why an expression was refused."},{"module":"ckx_sdk::cron","name":"CronError::fmt","kind":"method","signature":"fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result","docs":""},{"module":"ckx_sdk::cron","name":"Ctx::timer_cron","kind":"method","signature":"pub fn timer_cron(&self, name: &str, cron: &Cron) -> Result<()>","docs":"Runs [`Hub::on_timer`](crate::Hub::on_timer) with `name` at the next time `cron` fires, replacing any timer of that name. Call it again from `on_timer` to keep the schedule."},{"module":"ckx_sdk::cron","name":"Error::from","kind":"method","signature":"fn from(e: CronError) -> Self","docs":""},{"module":"ckx_sdk::emit","name":"MAX_DISTANCE","kind":"const","signature":"pub const MAX_DISTANCE: u8 = 8;","docs":""},{"module":"ckx_sdk::emit","name":"MAX_PAYLOAD","kind":"const","signature":"pub const MAX_PAYLOAD: usize = 1024;","docs":""},{"module":"ckx_sdk::emit","name":"Spatial","kind":"enum","signature":"pub enum Spatial<'a> { /// An actor's state: a server-driven actor appears and moves like a player's. Actor { state: &'a [u8] }, /// A voxel edit at `(x, y, z)` within the chunk, folded into the live mesh. The durable /// write is `ctx.world().set_voxels`, which already shows it; this is for effects. Voxel { x: i16, y: i16, z: i16, voxel_type: u16, state: &'a [u8] }, /// A server event (`event_type`, then `state`), as games route server events. Event { event_type: u16, state: &'a [u8] }, /// An app-defined payload. Generic { payload: &'a [u8] }, /// A message to the one actor named as the event's actor. ActorMessage { payload: &'a [u8] }, }","docs":"What a spatial event is to the players who receive it."},{"module":"ckx_sdk::emit","name":"Spatial::Actor","kind":"variant","signature":"Actor { state: &'a [u8] }","docs":"An actor's state: a server-driven actor appears and moves like a player's."},{"module":"ckx_sdk::emit","name":"Spatial::ActorMessage","kind":"variant","signature":"ActorMessage { payload: &'a [u8] }","docs":"A message to the one actor named as the event's actor."},{"module":"ckx_sdk::emit","name":"Spatial::Event","kind":"variant","signature":"Event { event_type: u16, state: &'a [u8] }","docs":"A server event (`event_type`, then `state`), as games route server events."},{"module":"ckx_sdk::emit","name":"Spatial::Generic","kind":"variant","signature":"Generic { payload: &'a [u8] }","docs":"An app-defined payload."},{"module":"ckx_sdk::emit","name":"Spatial::Voxel","kind":"variant","signature":"Voxel { x: i16, y: i16, z: i16, voxel_type: u16, state: &'a [u8] }","docs":"A voxel edit at `(x, y, z)` within the chunk, folded into the live mesh. The durable write is `ctx.world().set_voxels`, which already shows it; this is for effects."},{"module":"ckx_sdk::emit","name":"actor_id","kind":"function","signature":"pub fn actor_id(uuid: &str) -> [u8; 32]","docs":"A 32-byte actor id, as the realtime tier addresses actors. Players' actors use their 32-character uuid; a server-driven actor (an NPC, a mob) can use any 32 bytes."},{"module":"ckx_sdk::model","name":"Changes","kind":"struct","signature":"pub struct Changes { pub changed: Vec<u64>, pub removed: Vec<u64>, }","docs":"What changed since the last [`Model::take_changes`]."},{"module":"ckx_sdk::model","name":"Changes::changed","kind":"field","signature":"pub changed: Vec<u64>","docs":""},{"module":"ckx_sdk::model","name":"Changes::removed","kind":"field","signature":"pub removed: Vec<u64>","docs":""},{"module":"ckx_sdk::model","name":"Container","kind":"struct","signature":"pub struct Container { pub type_name: String, /// The player who owns it, if one does: they read its `Owner` properties. pub owner: Option<u64>, /// The key it was [`Model::ensure`]d under, if it was. pub key: Option<String>, /// Properties set so far; the rest read as their defaults. props: BTreeMap<String, Value>, }","docs":""},{"module":"ckx_sdk::model","name":"Container::key","kind":"field","signature":"pub key: Option<String>","docs":"The key it was [`Model::ensure`]d under, if it was."},{"module":"ckx_sdk::model","name":"Container::owner","kind":"field","signature":"pub owner: Option<u64>","docs":"The player who owns it, if one does: they read its `Owner` properties."},{"module":"ckx_sdk::model","name":"Container::type_name","kind":"field","signature":"pub type_name: String","docs":""},{"module":"ckx_sdk::model","name":"ContainerDef","kind":"struct","signature":"pub struct ContainerDef { props: BTreeMap<String, Prop>, }","docs":"Declares one container type's properties; see [`Schema::container`]."},{"module":"ckx_sdk::model","name":"ContainerDef::prop","kind":"method","signature":"pub fn prop(mut self, key: &str, kind: PropKind, default: impl Into<Value>, visibility: Visibility) -> Self","docs":"A property with its kind, its default, and who may read it. A default of the wrong kind panics when the schema is built, which is where a typo belongs."},{"module":"ckx_sdk::model","name":"Edge","kind":"struct","signature":"pub struct Edge { pub from: u64, pub relation: String, pub to: u64, }","docs":""},{"module":"ckx_sdk::model","name":"Edge::from","kind":"field","signature":"pub from: u64","docs":""},{"module":"ckx_sdk::model","name":"Edge::relation","kind":"field","signature":"pub relation: String","docs":""},{"module":"ckx_sdk::model","name":"Edge::to","kind":"field","signature":"pub to: u64","docs":""},{"module":"ckx_sdk::model","name":"MAX_DEPTH","kind":"const","signature":"pub const MAX_DEPTH: usize = 5;","docs":"The deepest [`Model::traverse`] walks, as the legacy graph traversal."},{"module":"ckx_sdk::model","name":"Model","kind":"struct","signature":"pub struct Model { next_id: u64, containers: BTreeMap<u64, Container>, /// `\"<type>\\0<key>\"` to the container ensured under it. keys: BTreeMap<String, u64>, edges: BTreeSet<Edge>, #[serde(skip)] changed: BTreeSet<u64>, #[serde(skip)] removed: BTreeSet<u64>, }","docs":""},{"module":"ckx_sdk::model","name":"Model::add","kind":"method","signature":"pub fn add(&mut self, schema: &Schema, id: u64, key: &str, delta: i64) -> Result<i64>","docs":"Adds `delta` to an integer property and returns the new value."},{"module":"ckx_sdk::model","name":"Model::container","kind":"method","signature":"pub fn container(&self, id: u64) -> Option<&Container>","docs":""},{"module":"ckx_sdk::model","name":"Model::create","kind":"method","signature":"pub fn create(&mut self, schema: &Schema, type_name: &str, owner: Option<u64>) -> Result<u64>","docs":"A new container of `type_name`, with every property at its default."},{"module":"ckx_sdk::model","name":"Model::delete","kind":"method","signature":"pub fn delete(&mut self, id: u64) -> bool","docs":"Removes a container, its key and every edge touching it."},{"module":"ckx_sdk::model","name":"Model::ensure","kind":"method","signature":"pub fn ensure(&mut self, schema: &Schema, type_name: &str, key: &str, owner: Option<u64>) -> Result<u64>","docs":"The container of `type_name` under `key`, created the first time: a player's character, a match's scoreboard."},{"module":"ckx_sdk::model","name":"Model::find","kind":"method","signature":"pub fn find(&self, type_name: &str, key: &str) -> Option<u64>","docs":""},{"module":"ckx_sdk::model","name":"Model::get","kind":"method","signature":"pub fn get(&self, schema: &Schema, id: u64, key: &str) -> Result<Value>","docs":"A property's value, or its default when it was never set."},{"module":"ckx_sdk::model","name":"Model::get_bool","kind":"method","signature":"pub fn get_bool(&self, schema: &Schema, id: u64, key: &str) -> Result<bool>","docs":""},{"module":"ckx_sdk::model","name":"Model::get_f64","kind":"method","signature":"pub fn get_f64(&self, schema: &Schema, id: u64, key: &str) -> Result<f64>","docs":""},{"module":"ckx_sdk::model","name":"Model::get_i64","kind":"method","signature":"pub fn get_i64(&self, schema: &Schema, id: u64, key: &str) -> Result<i64>","docs":""},{"module":"ckx_sdk::model","name":"Model::get_str","kind":"method","signature":"pub fn get_str(&self, schema: &Schema, id: u64, key: &str) -> Result<String>","docs":""},{"module":"ckx_sdk::model","name":"Model::link","kind":"method","signature":"pub fn link(&mut self, from: u64, relation: &str, to: u64) -> Result<()>","docs":"`from --relation--> to`, e.g. an inventory holding an item."},{"module":"ckx_sdk::model","name":"Model::linked","kind":"method","signature":"pub fn linked(&self, from: u64, relation: &str) -> Vec<u64>","docs":"The containers `from` links to by `relation`."},{"module":"ckx_sdk::model","name":"Model::new","kind":"method","signature":"pub fn new() -> Self","docs":""},{"module":"ckx_sdk::model","name":"Model::of_type","kind":"method","signature":"pub fn of_type<'a>(&'a self, type_name: &'a str) -> impl Iterator<Item = u64> + 'a","docs":"Every container of `type_name`, oldest first."},{"module":"ckx_sdk::model","name":"Model::public_changes","kind":"method","signature":"pub fn public_changes(&mut self, schema: &Schema) -> Vec<Published>","docs":"The changes since the last call as what anyone may see: each changed container's public view, and each removal."},{"module":"ckx_sdk::model","name":"Model::publish_changes","kind":"method","signature":"pub fn publish_changes(&mut self, ctx: &Ctx, schema: &Schema, topic: &str)","docs":"Publishes [`Model::public_changes`] on this hub's `topic`, one message per container, for subscribed clients. Owner and hidden properties are never published."},{"module":"ckx_sdk::model","name":"Model::set","kind":"method","signature":"pub fn set(&mut self, schema: &Schema, id: u64, key: &str, value: impl Into<Value>) -> Result<()>","docs":"Sets a property, refusing a value of the wrong kind."},{"module":"ckx_sdk::model","name":"Model::take_changes","kind":"method","signature":"pub fn take_changes(&mut self) -> Changes","docs":"The containers changed and removed since the last call."},{"module":"ckx_sdk::model","name":"Model::traverse","kind":"method","signature":"pub fn traverse(&self, root: u64, relation: &str, depth: usize) -> Vec<u64>","docs":"Every container reachable from `root` by `relation`, breadth first, at most [`MAX_DEPTH`] steps away; `root` itself is not included."},{"module":"ckx_sdk::model","name":"Model::unlink","kind":"method","signature":"pub fn unlink(&mut self, from: u64, relation: &str, to: u64) -> bool","docs":""},{"module":"ckx_sdk::model","name":"Model::view","kind":"method","signature":"pub fn view(&self, schema: &Schema, id: u64, viewer: Viewer) -> Result<BTreeMap<String, Value>>","docs":"The properties `viewer` may read, with defaults filled in: every one for the server, public ones for a player, and owner ones too on containers the player owns."},{"module":"ckx_sdk::model","name":"Prop","kind":"struct","signature":"pub struct Prop { pub kind: PropKind, pub default: Value, pub visibility: Visibility, }","docs":""},{"module":"ckx_sdk::model","name":"Prop::default","kind":"field","signature":"pub default: Value","docs":""},{"module":"ckx_sdk::model","name":"Prop::kind","kind":"field","signature":"pub kind: PropKind","docs":""},{"module":"ckx_sdk::model","name":"Prop::visibility","kind":"field","signature":"pub visibility: Visibility","docs":""},{"module":"ckx_sdk::model","name":"PropKind","kind":"enum","signature":"pub enum PropKind { Bool, Int, Float, Str, Json, }","docs":"What a property holds. `Json` holds any JSON value."},{"module":"ckx_sdk::model","name":"PropKind::Bool","kind":"variant","signature":"Bool","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Float","kind":"variant","signature":"Float","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Int","kind":"variant","signature":"Int","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Json","kind":"variant","signature":"Json","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Str","kind":"variant","signature":"Str","docs":""},{"module":"ckx_sdk::model","name":"Published","kind":"struct","signature":"pub struct Published { pub id: u64, #[serde(default, skip_serializing_if = \"Option::is_none\")] pub type_name: Option<String>, #[serde(default, skip_serializing_if = \"Option::is_none\")] pub props: Option<BTreeMap<String, Value>>, #[serde(default, skip_serializing_if = \"std::ops::Not::not\")] pub removed: bool, }","docs":"One published change: a container's public view, or its removal."},{"module":"ckx_sdk::model","name":"Published::id","kind":"field","signature":"pub id: u64","docs":""},{"module":"ckx_sdk::model","name":"Published::props","kind":"field","signature":"pub props: Option<BTreeMap<String, Value>>","docs":""},{"module":"ckx_sdk::model","name":"Published::removed","kind":"field","signature":"pub removed: bool","docs":""},{"module":"ckx_sdk::model","name":"Published::type_name","kind":"field","signature":"pub type_name: Option<String>","docs":""},{"module":"ckx_sdk::model","name":"Schema","kind":"struct","signature":"pub struct Schema { types: BTreeMap<String, BTreeMap<String, Prop>>, }","docs":"The declared container types and their properties."},{"module":"ckx_sdk::model","name":"Schema::container","kind":"method","signature":"pub fn container(mut self, name: &str, define: impl FnOnce(ContainerDef) -> ContainerDef) -> Self","docs":""},{"module":"ckx_sdk::model","name":"Schema::new","kind":"method","signature":"pub fn new() -> Self","docs":""},{"module":"ckx_sdk::model","name":"Viewer","kind":"enum","signature":"pub enum Viewer { /// The hub, another instance or a developer: every property. Server, /// A player: public properties, and owner ones on containers the player owns. Player(u64), /// Anyone: public properties only, as [`Model::publish_changes`] sends them. Public, }","docs":"Who a [`Model::view`] is for."},{"module":"ckx_sdk::model","name":"Viewer::Player","kind":"variant","signature":"Player(u64)","docs":"A player: public properties, and owner ones on containers the player owns."},{"module":"ckx_sdk::model","name":"Viewer::Public","kind":"variant","signature":"Public","docs":"Anyone: public properties only, as [`Model::publish_changes`] sends them."},{"module":"ckx_sdk::model","name":"Viewer::Server","kind":"variant","signature":"Server","docs":"The hub, another instance or a developer: every property."},{"module":"ckx_sdk::model","name":"Visibility","kind":"enum","signature":"pub enum Visibility { Public, Owner, Hidden, }","docs":"Who may read a property: anyone who may read the container, only its owner, or nobody but the hub itself (secret stats, seeds)."},{"module":"ckx_sdk::model","name":"Visibility::Hidden","kind":"variant","signature":"Hidden","docs":""},{"module":"ckx_sdk::model","name":"Visibility::Owner","kind":"variant","signature":"Owner","docs":""},{"module":"ckx_sdk::model","name":"Visibility::Public","kind":"variant","signature":"Public","docs":""},{"module":"ckx_sdk::node","name":"Actor","kind":"struct","signature":"pub struct Actor { /// The 32-character actor id. pub uuid: String, pub player: Option<u64>, pub chunk: ChunkPos, /// The actor's persisted public state, where the game keeps one. pub state: Option<Vec<u8>>, }","docs":"A player's actor in the world, from live presence."},{"module":"ckx_sdk::node","name":"Actor::chunk","kind":"field","signature":"pub chunk: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Actor::player","kind":"field","signature":"pub player: Option<u64>","docs":""},{"module":"ckx_sdk::node","name":"Actor::state","kind":"field","signature":"pub state: Option<Vec<u8>>","docs":"The actor's persisted public state, where the game keeps one."},{"module":"ckx_sdk::node","name":"Actor::uuid","kind":"field","signature":"pub uuid: String","docs":"The 32-character actor id."},{"module":"ckx_sdk::node","name":"Chunk","kind":"struct","signature":"pub struct Chunk { pub id: u64, pub at: ChunkPos, pub voxels: Option<Vec<u8>>, pub chunk_state: Option<Vec<u8>>, }","docs":"A chunk as stored: the dense voxel grid and the game's own metadata blob."},{"module":"ckx_sdk::node","name":"Chunk::at","kind":"field","signature":"pub at: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Chunk::chunk_state","kind":"field","signature":"pub chunk_state: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"Chunk::id","kind":"field","signature":"pub id: u64","docs":""},{"module":"ckx_sdk::node","name":"Chunk::voxels","kind":"field","signature":"pub voxels: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos","kind":"struct","signature":"pub struct ChunkPos { pub x: i64, pub y: i64, pub z: i64, }","docs":"A chunk's coordinates."},{"module":"ckx_sdk::node","name":"ChunkPos::from","kind":"method","signature":"fn from(p: WirePos) -> Self","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::new","kind":"method","signature":"pub const fn new(x: i64, y: i64, z: i64) -> Self","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::x","kind":"field","signature":"pub x: i64","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::y","kind":"field","signature":"pub y: i64","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::z","kind":"field","signature":"pub z: i64","docs":""},{"module":"ckx_sdk::node","name":"Grid","kind":"struct","signature":"pub struct Grid { pub id: u64, pub low: ChunkPos, pub high: ChunkPos, }","docs":"A grid: a box of chunks with its own permissions."},{"module":"ckx_sdk::node","name":"Grid::contains","kind":"method","signature":"pub fn contains(&self, at: ChunkPos) -> bool","docs":""},{"module":"ckx_sdk::node","name":"Grid::high","kind":"field","signature":"pub high: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Grid::id","kind":"field","signature":"pub id: u64","docs":""},{"module":"ckx_sdk::node","name":"Grid::low","kind":"field","signature":"pub low: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"GridPick","kind":"enum","signature":"pub enum GridPick { /// The lowest grid id: what the realtime tier enforces. #[default] First, Smallest, Largest, }","docs":"Which grid [`Grids::at`] returns where grids overlap."},{"module":"ckx_sdk::node","name":"GridPick::First","kind":"variant","signature":"First","docs":"The lowest grid id: what the realtime tier enforces."},{"module":"ckx_sdk::node","name":"GridPick::Largest","kind":"variant","signature":"Largest","docs":""},{"module":"ckx_sdk::node","name":"GridPick::Smallest","kind":"variant","signature":"Smallest","docs":""},{"module":"ckx_sdk::node","name":"Grids","kind":"struct","signature":"pub struct Grids<'a>(pub(crate) &'a Ctx);","docs":"Grid lookups: [`Ctx::grids`]."},{"module":"ckx_sdk::node","name":"Grids::at","kind":"method","signature":"pub fn at(&self, at: ChunkPos, pick: GridPick) -> Result<Option<Grid>, CallError>","docs":"The grid covering chunk `at`, if any. Scope `grids.read`."},{"module":"ckx_sdk::node","name":"Grids::check_permission","kind":"method","signature":"pub fn check_permission(&self, grid: u64, player: u64, permission: &str) -> Result<bool, CallError>","docs":"Whether `player` holds `permission` on `grid` (granted directly or through a group, and not expired). Scope `grids.read`."},{"module":"ckx_sdk::node","name":"Grids::get","kind":"method","signature":"pub fn get(&self, grid: u64) -> Result<Option<Grid>, CallError>","docs":"One of this app's grids. Scope `grids.read`."},{"module":"ckx_sdk::node","name":"MAX_VOXEL_STATE","kind":"const","signature":"pub const MAX_VOXEL_STATE: usize = 1024;","docs":"A voxel's state bytes."},{"module":"ckx_sdk::node","name":"MAX_VOXEL_WRITES","kind":"const","signature":"pub const MAX_VOXEL_WRITES: usize = 16;","docs":"Voxel writes in one [`World::set_voxels`] call."},{"module":"ckx_sdk::node","name":"Permissions","kind":"struct","signature":"pub struct Permissions<'a>(pub(crate) &'a Ctx);","docs":"Grid permission grants: [`Ctx::permissions`]."},{"module":"ckx_sdk::node","name":"Permissions::grant","kind":"method","signature":"pub fn grant(&self, grid: u64, player: u64, keys: &[&str], ttl_secs: Option<u32>) -> Result<Option<String>, CallError>","docs":"Grants runtime permission keys on one of this app's grids to a player with access to the app, for `ttl_secs` or until revoked. Returns when the grant expires (RFC 3339), if it does. Scope `permissions.write`."},{"module":"ckx_sdk::node","name":"Permissions::revoke","kind":"method","signature":"pub fn revoke(&self, grid: u64, player: u64, keys: Option<&[&str]>) -> Result<(), CallError>","docs":"Revokes the named keys, or every key when `keys` is `None`. Scope `permissions.write`."},{"module":"ckx_sdk::node","name":"Player","kind":"struct","signature":"pub struct Player { #[serde(deserialize_with = \"de_u64\")] pub player: u64, pub gamertag: String, pub disambiguation: String, }","docs":"A player's public identity."},{"module":"ckx_sdk::node","name":"Player::disambiguation","kind":"field","signature":"pub disambiguation: String","docs":""},{"module":"ckx_sdk::node","name":"Player::gamertag","kind":"field","signature":"pub gamertag: String","docs":""},{"module":"ckx_sdk::node","name":"Player::player","kind":"field","signature":"pub player: u64","docs":""},{"module":"ckx_sdk::node","name":"Players","kind":"struct","signature":"pub struct Players<'a>(pub(crate) &'a Ctx);","docs":"Player lookups and app state: [`Ctx::players`]."},{"module":"ckx_sdk::node","name":"Players::avatar_state","kind":"method","signature":"pub fn avatar_state(&self, avatar: u64) -> Result<Option<Vec<u8>>, CallError>","docs":"An avatar's state blob for this app. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::check_permission","kind":"method","signature":"pub fn check_permission(&self, player: u64, group: u64, permission: Option<&str>) -> Result<bool, CallError>","docs":"Whether the player is an active member of one of this app's groups (teams, channels), or holds `permission` in it when one is named. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::features","kind":"method","signature":"pub fn features(&self, player: u64) -> Result<Vec<String>, CallError>","docs":"The feature keys the player's access tier grants in this app. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::get","kind":"method","signature":"pub fn get(&self, player: u64) -> Result<Player, CallError>","docs":"A player's public identity, for players currently in this app. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::set_state","kind":"method","signature":"pub fn set_state(&self, player: u64, state: Option<&[u8]>) -> Result<(), CallError>","docs":"Replaces the player's state blob for this app (at most 256 KiB; `None` clears it). The player must have access to the app. Scope `players.write`."},{"module":"ckx_sdk::node","name":"Players::state","kind":"method","signature":"pub fn state(&self, player: u64) -> Result<Option<Vec<u8>>, CallError>","docs":"The player's state blob for this app, which game clients read too. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Voxel","kind":"struct","signature":"pub struct Voxel { pub x: i16, pub y: i16, pub z: i16, pub voxel_type: u16, pub state: Option<Vec<u8>>, }","docs":"A voxel written into a chunk (the edits on top of its dense grid)."},{"module":"ckx_sdk::node","name":"Voxel::state","kind":"field","signature":"pub state: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"Voxel::voxel_type","kind":"field","signature":"pub voxel_type: u16","docs":""},{"module":"ckx_sdk::node","name":"Voxel::x","kind":"field","signature":"pub x: i16","docs":""},{"module":"ckx_sdk::node","name":"Voxel::y","kind":"field","signature":"pub y: i16","docs":""},{"module":"ckx_sdk::node","name":"Voxel::z","kind":"field","signature":"pub z: i16","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite","kind":"struct","signature":"pub struct VoxelWrite { pub chunk: ChunkPos, pub voxel: (i16, i16, i16), pub voxel_type: u16, pub state: Option<Vec<u8>>, }","docs":"One voxel to write: `voxel` is its position within `chunk`."},{"module":"ckx_sdk::node","name":"VoxelWrite::chunk","kind":"field","signature":"pub chunk: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite::state","kind":"field","signature":"pub state: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite::voxel","kind":"field","signature":"pub voxel: (i16, i16, i16)","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite::voxel_type","kind":"field","signature":"pub voxel_type: u16","docs":""},{"module":"ckx_sdk::node","name":"World","kind":"struct","signature":"pub struct World<'a>(pub(crate) &'a Ctx);","docs":"World reads and writes: [`Ctx::world`]."},{"module":"ckx_sdk::node","name":"World::actors","kind":"method","signature":"pub fn actors(&self, at: ChunkPos) -> Result<Vec<Actor>, CallError>","docs":"The actors in one chunk. Scope `world.read`."},{"module":"ckx_sdk::node","name":"World::actors_near","kind":"method","signature":"pub fn actors_near(&self, center: ChunkPos, radius_xz: u8, radius_y: u8) -> Result<Vec<Actor>, CallError>","docs":"The actors within `radius_xz` chunks across and `radius_y` up and down (at most 3 and 1). Scope `world.read`."},{"module":"ckx_sdk::node","name":"World::chunk","kind":"method","signature":"pub fn chunk(&self, at: ChunkPos) -> Result<Option<Chunk>, CallError>","docs":"The chunk at `at`, or `None` when the app never stored it. Scope `world.read`."},{"module":"ckx_sdk::node","name":"World::set_voxels","kind":"method","signature":"pub fn set_voxels(&self, writes: &[VoxelWrite]) -> Result<Vec<u64>, CallError>","docs":"Writes up to [`MAX_VOXEL_WRITES`] voxels in one transaction, as the app, and shows them to nearby players. Returns the voxel update ids. Scope `world.write`."},{"module":"ckx_sdk::node","name":"World::voxels","kind":"method","signature":"pub fn voxels(&self, at: ChunkPos) -> Result<Vec<Voxel>, CallError>","docs":"The voxels written into a chunk, at most 2,048. Scope `world.read`."},{"module":"ckx_sdk::prelude","name":"Cron","kind":"reexport","signature":"pub use crate::cron::Cron;","docs":""},{"module":"ckx_sdk::prelude","name":"crate::emit::{Spatial, actor_id}","kind":"reexport","signature":"pub use crate::emit::{Spatial, actor_id};","docs":""},{"module":"ckx_sdk::prelude","name":"crate::model::{Model, PropKind, Schema, Viewer, Visibility}","kind":"reexport","signature":"pub use crate::model::{Model, PropKind, Schema, Viewer, Visibility};","docs":""},{"module":"ckx_sdk::prelude","name":"crate::node::{ChunkPos, GridPick, VoxelWrite}","kind":"reexport","signature":"pub use crate::node::{ChunkPos, GridPick, VoxelWrite};","docs":""},{"module":"ckx_sdk::prelude","name":"crate::{\n Call, CallError, Caller, Ctx, Error, Hub, Kind, Level, Presence, PresencePlayer, Result, Session, Spoke, Status, TopicMsg,\n WorldEvent, decode, encode,\n }","kind":"reexport","signature":"pub use crate::{ Call, CallError, Caller, Ctx, Error, Hub, Kind, Level, Presence, PresencePlayer, Result, Session, Spoke, Status, TopicMsg, WorldEvent, decode, encode, };","docs":""},{"module":"ckx_sdk::prelude","name":"serde::{Deserialize, Serialize}","kind":"reexport","signature":"pub use serde::{Deserialize, Serialize};","docs":""},{"module":"core","name":"assert","kind":"macro","signature":"assert!(condition[, message])","docs":"Panics when a condition is false."},{"module":"core","name":"assert_eq","kind":"macro","signature":"assert_eq!(left, right[, message])","docs":"Panics when two expressions are not equal."},{"module":"core","name":"matches","kind":"macro","signature":"matches!(expression, pattern [if guard])","docs":"Checks whether an expression matches a pattern."},{"module":"core","name":"panic","kind":"macro","signature":"panic!([message])","docs":"Terminates the current execution with an error."},{"module":"core::mem","name":"drop","kind":"function","signature":"pub fn drop<T>(_x: T)","docs":"Consumes and drops a value."},{"module":"core::mem","name":"forget","kind":"function","signature":"pub const fn forget<T>(t: T)","docs":"Consumes a value without running its destructor."},{"module":"core::prelude::v1","name":"Clone","kind":"trait","signature":"pub trait Clone { fn clone(&self) -> Self; }","docs":"Explicitly duplicates a value."},{"module":"core::prelude::v1","name":"Copy","kind":"trait","signature":"pub trait Copy: Clone","docs":"Marks values duplicated by assignment."},{"module":"core::prelude::v1","name":"Default","kind":"trait","signature":"pub trait Default { fn default() -> Self; }","docs":"Constructs a useful default value."},{"module":"core::prelude::v1","name":"Err","kind":"variant","signature":"Err(E) -> Result<T, E>","docs":"Constructs an error Result value."},{"module":"core::prelude::v1","name":"IntoIterator","kind":"trait","signature":"pub trait IntoIterator { type Item; type IntoIter: Iterator<Item = Self::Item>; }","docs":"Converts a value into an iterator."},{"module":"core::prelude::v1","name":"Iterator","kind":"trait","signature":"pub trait Iterator { type Item; fn next(&mut self) -> Option<Self::Item>; }","docs":"Produces a sequence of values."},{"module":"core::prelude::v1","name":"None","kind":"variant","signature":"None -> Option<T>","docs":"Constructs an absent Option value."},{"module":"core::prelude::v1","name":"Ok","kind":"variant","signature":"Ok(T) -> Result<T, E>","docs":"Constructs a successful Result value."},{"module":"core::prelude::v1","name":"Option","kind":"enum","signature":"pub enum Option<T> { None, Some(T) }","docs":"An optional value."},{"module":"core::prelude::v1","name":"Result","kind":"enum","signature":"pub enum Result<T, E> { Ok(T), Err(E) }","docs":"A success value or an error."},{"module":"core::prelude::v1","name":"Some","kind":"variant","signature":"Some(T) -> Option<T>","docs":"Constructs a present Option value."},{"module":"core::slice","name":"from_raw_parts","kind":"function","signature":"pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T]","docs":"Forms a slice from a pointer and element count."},{"module":"crowdy_client_sdk","name":"ABI_VERSION","kind":"const","signature":"pub const ABI_VERSION: u32 = 0;","docs":""},{"module":"crowdy_client_sdk","name":"HostError","kind":"struct","signature":"pub struct HostError { pub kind: String, #[serde(default)] pub message: Option<String>, }","docs":"A host call the broker or the page refused, or that failed. The browser answers a refusal (outside the allowlist, outside the grid, over a rate cap, not offered by this game) with `kind` `denied` and a message saying why."},{"module":"crowdy_client_sdk","name":"HostError::fmt","kind":"method","signature":"fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result","docs":""},{"module":"crowdy_client_sdk","name":"HostError::kind","kind":"field","signature":"pub kind: String","docs":""},{"module":"crowdy_client_sdk","name":"HostError::message","kind":"field","signature":"pub message: Option<String>","docs":""},{"module":"crowdy_client_sdk","name":"api","kind":"module","signature":"pub mod api","docs":"The client host calls. The broker confines each to the mod's grid (chunk coordinates inside the grid's box, `gridId` the mod's own) and the page answers it as the visiting player, with that player's permissions; a game may leave some unanswered (`denied`). Ids are strings where they may exceed 2^53."},{"module":"crowdy_client_sdk","name":"ck_alloc","kind":"function","signature":"pub extern \"C\" fn ck_alloc(len: u32) -> *mut u8","docs":"Allocates a buffer the host writes into before it calls an export."},{"module":"crowdy_client_sdk","name":"ck_free","kind":"function","signature":"pub unsafe extern \"C\" fn ck_free(ptr: *mut u8, len: u32)","docs":"Releases a buffer handed across the boundary. # Safety `ptr`/`len` must come from `ck_alloc` or a packed return value."},{"module":"crowdy_client_sdk","name":"host","kind":"module","signature":"pub mod host","docs":"Host imports (module `ck`)."},{"module":"crowdy_client_sdk","name":"host_call","kind":"function","signature":"pub fn host_call(fn_name: &str, args: serde_json::Value) -> Result<serde_json::Value, HostError>","docs":"Calls a host function with JSON args and returns its `data`."},{"module":"crowdy_client_sdk","name":"input_slice","kind":"function","signature":"pub unsafe fn input_slice<'a>(ptr: *const u8, len: u32) -> &'a [u8]","docs":"A host-provided buffer. # Safety `ptr`/`len` must describe a live buffer in guest memory."},{"module":"crowdy_client_sdk","name":"log","kind":"function","signature":"pub fn log(level: u32, msg: &str)","docs":""},{"module":"crowdy_client_sdk","name":"now_ms","kind":"function","signature":"pub fn now_ms() -> u64","docs":""},{"module":"crowdy_client_sdk","name":"pack_return","kind":"function","signature":"pub fn pack_return(bytes: Vec<u8>) -> u64","docs":"Leaks `bytes` and packs its (ptr, len) into the u64 return convention."},{"module":"crowdy_client_sdk","name":"random_bytes","kind":"function","signature":"pub fn random_bytes(len: usize) -> Vec<u8>","docs":"Random bytes from the browser's `crypto.getRandomValues`."},{"module":"crowdy_client_sdk","name":"register_module","kind":"macro","signature":"macro_rules! register_module { (init: $init:path, tick: $tick:path, invoke: $invoke:path $(,)?) => { $crate::__register_module_core!($init, $tick, $invoke); }; (init: $init:path, tick: $tick:path, invoke: $invoke:path, event: $event:path $(,)?) => { $crate::__register_module_core!($init, $tick, $invoke); #[export_name = \"on_event\"] pub extern \"C\" fn __ck_export_on_event(ptr: *const u8, len: u32) { let input = unsafe { $crate::input_slice(ptr, len) }; $event(input); } }; }","docs":"Wires a CLIENT half's functions to the exports the browser calls: `init()`, `tick(dt_ms)`, `handle_invoke(ptr, len) -> packed u64`, and, in the four-argument form, `on_event(ptr, len)` for grid events from the page's bus. The three-argument form exports no `on_event`. ```ignore use crowdy_client_sdk as crowdy; fn init() {} fn tick(_dt_ms: u32) { let _ = crowdy::api::hud_set(serde_json::json!({ \"text\": \"hello\" })); } fn invoke(payload: &[u8]) -> Vec<u8> { payload.to_vec() } crowdy::register_module!(init: init, tick: tick, invoke: invoke); ```"},{"module":"crowdy_client_sdk","name":"state_get","kind":"function","signature":"pub fn state_get() -> Vec<u8>","docs":"The state blob (empty when unset)."},{"module":"crowdy_client_sdk","name":"state_set","kind":"function","signature":"pub fn state_set(bytes: &[u8]) -> bool","docs":"Replaces the state blob."},{"module":"crowdy_client_sdk::api","name":"actors_list","kind":"function","signature":"pub fn actors_list(x: i64, y: i64, z: i64) -> Result<Value, HostError>","docs":"The actors in one chunk inside the grid, as the page sees them."},{"module":"crowdy_client_sdk::api","name":"actors_list_radius","kind":"function","signature":"pub fn actors_list_radius( x: i64, y: i64, z: i64, radius_xz: u8, radius_y: u8, ) -> Result<Value, HostError>","docs":"The actors in a box of chunks around (x, y, z): `radius_xz` at most 3 and `radius_y` at most 1, clipped to the grid."},{"module":"crowdy_client_sdk::api","name":"avatar_state_get","kind":"function","signature":"pub fn avatar_state_get(avatar_id: &str) -> Result<Value, HostError>","docs":"An avatar's app state, for an avatar whose actor is inside the grid."},{"module":"crowdy_client_sdk::api","name":"chunk_get","kind":"function","signature":"pub fn chunk_get(x: i64, y: i64, z: i64) -> Result<Value, HostError>","docs":"One chunk inside the grid: `{ voxelsBase64 }`."},{"module":"crowdy_client_sdk::api","name":"emit_channel","kind":"function","signature":"pub fn emit_channel(channel_id: &str, payload_base64: &str) -> Result<Value, HostError>","docs":"Posts to one of the grid's channels."},{"module":"crowdy_client_sdk::api","name":"emit_event","kind":"function","signature":"pub fn emit_event(name: &str, payload: Value) -> Result<Value, HostError>","docs":"Publishes an event on the page's grid event bus, which the other CLIENT mods of this grid on the same page receive through `on_event`. Nothing leaves the page."},{"module":"crowdy_client_sdk::api","name":"emit_event_to","kind":"function","signature":"pub fn emit_event_to(target: &str, name: &str, payload: Value) -> Result<Value, HostError>","docs":"[`emit_event`] addressed to one mod on the bus by name, whether or not it listens for `name`."},{"module":"crowdy_client_sdk::api","name":"emit_spatial","kind":"function","signature":"pub fn emit_spatial( kind: &str, chunk: (i64, i64, i64), uuid_hex: &str, payload_base64: &str, distance: u8, decay: u8, ) -> Result<Value, HostError>","docs":"Sends a spatial message from a chunk inside the grid, as the visiting player's client. `kind` is `actor`, `client_event`, `server_event` or `text`; `uuid_hex` is 64 hex characters; `distance` is at most 8."},{"module":"crowdy_client_sdk::api","name":"grid_info","kind":"function","signature":"pub fn grid_info() -> Result<Value, HostError>","docs":"The mod's own grid, answered by the broker: `{ low: {x,y,z}, high: {x,y,z} }` in chunk coordinates, as decimal strings."},{"module":"crowdy_client_sdk::api","name":"grid_permission_check","kind":"function","signature":"pub fn grid_permission_check( user_id: &str, grid_id: &str, permission_key: &str, ) -> Result<bool, HostError>","docs":"Whether the visiting player holds `permission_key` on this grid."},{"module":"crowdy_client_sdk::api","name":"hud_set","kind":"function","signature":"pub fn hud_set(payload: Value) -> Result<Value, HostError>","docs":"Hands `payload` to the game's HUD channel. The mod never touches the DOM; a game that offers no HUD answers `{ delivered: false }`."},{"module":"crowdy_client_sdk::api","name":"overlay_draw","kind":"function","signature":"pub fn overlay_draw(payload: Value) -> Result<Value, HostError>","docs":"Hands `payload` to the game's overlay channel, as [`hud_set`] does."},{"module":"crowdy_client_sdk::api","name":"pointer_clicks","kind":"function","signature":"pub fn pointer_clicks() -> Result<Value, HostError>","docs":"Drains the mouse clicks queued since the last call: `{ nowMs, buttons, holdingMs, clicks }`. `buttons` is `MouseEvent.buttons` (1 = left held); `holdingMs` maps a button index to how long it has been held (`\"0\"` = left); each click is `{ t: \"down\"|\"up\", button, atMs, heldMs?, nx, ny }` in canvas coordinates from -1 to 1 (+ny up). Call it every tick."},{"module":"crowdy_client_sdk::api","name":"user_state_get","kind":"function","signature":"pub fn user_state_get(user_id: &str) -> Result<Value, HostError>","docs":"The visiting player's app state."},{"module":"crowdy_client_sdk::api","name":"user_state_set","kind":"function","signature":"pub fn user_state_set(user_id: &str, state_base64: &str) -> Result<Value, HostError>","docs":"Replaces the visiting player's app state; `state_base64` is the new bytes."},{"module":"crowdy_client_sdk::api","name":"voxel_set","kind":"function","signature":"pub fn voxel_set( chunk: (i64, i64, i64), voxel: (u8, u8, u8), voxel_type: i32, state_base64: Option<&str>, ) -> Result<Value, HostError>","docs":"Writes one voxel inside the grid, as the visiting player (their `update_voxel_data`)."},{"module":"crowdy_client_sdk::api","name":"voxels_list","kind":"function","signature":"pub fn voxels_list(x: i64, y: i64, z: i64) -> Result<Value, HostError>","docs":"The voxels recorded in one chunk inside the grid."},{"module":"crowdy_client_sdk::host","name":"host_call","kind":"function","signature":"pub fn host_call(ptr: *const u8, len: u32) -> u64;","docs":"The host-call gateway: a JSON request in guest memory, answered synchronously with a packed (resp_ptr << 32 | resp_len) JSON response that the guest frees."},{"module":"crowdy_client_sdk::host","name":"log","kind":"function","signature":"pub fn log(level: u32, ptr: *const u8, len: u32);","docs":"level: 0 debug, 1 info, 2 warn, 3 error."},{"module":"crowdy_client_sdk::host","name":"now_ms","kind":"function","signature":"pub fn now_ms() -> u64;","docs":"Milliseconds since the Unix epoch, from the browser's clock."},{"module":"crowdy_client_sdk::host","name":"state_get","kind":"function","signature":"pub fn state_get(dest: *mut u8, cap: u32) -> u32;","docs":"Copies up to `cap` bytes of the state blob into `dest` and returns the blob's full length (call with `cap = 0` to size it)."},{"module":"crowdy_client_sdk::host","name":"state_set","kind":"function","signature":"pub fn state_set(ptr: *const u8, len: u32) -> u32;","docs":"Replaces the state blob. Returns 0."}]}
|
|
1
|
+
{"schemaVersion":2,"rustVersion":"1.97.1","sdkVersion":"0.1.0","abiVersion":0,"contentHash":"70df75c058b2550cfcb558ba28307b38689af8db7985f95fd83d38d42516f78b","crates":[{"name":"alloc","version":"1.97.1","sourceHash":"7386c02231ab279f515a3768adc6662d2f043ef8ab3a9f88af6b38c1c226a7eb"},{"name":"ckx-sdk","version":"0.10.0","sourceHash":"df1f3eabc835576f266a28d879419c4f7d0e871c063f2238097ebfa81b05796c"},{"name":"core","version":"1.97.1","sourceHash":"7386c02231ab279f515a3768adc6662d2f043ef8ab3a9f88af6b38c1c226a7eb"},{"name":"crowdy-client-sdk","version":"0.1.0","sourceHash":"f176bc8c68bcb60dda2104b2270ca2b41ec33c299b03c9eec1c4cd1d1a479098"}],"symbols":[{"module":"alloc","name":"format","kind":"macro","signature":"format!(format_string, ...)","docs":"Creates a formatted String."},{"module":"alloc","name":"vec","kind":"macro","signature":"vec![values...]","docs":"Creates a Vec from values or a repeated value."},{"module":"alloc::boxed","name":"Box","kind":"struct","signature":"pub struct Box<T>","docs":"An owned heap allocation."},{"module":"alloc::string","name":"String","kind":"struct","signature":"pub struct String","docs":"A UTF-8 encoded growable string."},{"module":"alloc::vec","name":"Vec","kind":"struct","signature":"pub struct Vec<T>","docs":"A contiguous growable array."},{"module":"ckx_sdk","name":"Call","kind":"struct","signature":"pub struct Call<'a> { pub caller: Caller, pub method: &'a str, pub payload: &'a [u8], }","docs":"One incoming call."},{"module":"ckx_sdk","name":"Call::caller","kind":"field","signature":"pub caller: Caller","docs":""},{"module":"ckx_sdk","name":"Call::decode","kind":"method","signature":"pub fn decode<T: DeserializeOwned>(&self) -> Result<T>","docs":""},{"module":"ckx_sdk","name":"Call::developer","kind":"method","signature":"pub fn developer(&self) -> Result<u64>","docs":"The calling developer, or an error when the caller is not one: the guard for an admin endpoint."},{"module":"ckx_sdk","name":"Call::method","kind":"field","signature":"pub method: &'a str","docs":""},{"module":"ckx_sdk","name":"Call::payload","kind":"field","signature":"pub payload: &'a [u8]","docs":""},{"module":"ckx_sdk","name":"Call::player","kind":"method","signature":"pub fn player(&self) -> Result<u64>","docs":"The calling player, or an error when the caller is not a player."},{"module":"ckx_sdk","name":"CallError","kind":"struct","signature":"pub struct CallError { pub status: Status, pub message: String, }","docs":"A failed call made by this instance."},{"module":"ckx_sdk","name":"CallError::fmt","kind":"method","signature":"fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result","docs":""},{"module":"ckx_sdk","name":"CallError::message","kind":"field","signature":"pub message: String","docs":""},{"module":"ckx_sdk","name":"CallError::status","kind":"field","signature":"pub status: Status","docs":""},{"module":"ckx_sdk","name":"Caller","kind":"enum","signature":"pub enum Caller { Platform, Instance(u64), Player(u64), /// A developer of the app (the org's `manage_compute`), by user id, connected with /// `execConnectAsDeveloper`: studio tools, manual runs and admin endpoints. It may call any /// type, not only `client` ones, so check for it in handlers only developers should reach. Developer(u64), }","docs":"Who is calling. The platform sets this; a handler can trust it for authorization."},{"module":"ckx_sdk","name":"Caller::Developer","kind":"variant","signature":"Developer(u64)","docs":"A developer of the app (the org's `manage_compute`), by user id, connected with `execConnectAsDeveloper`: studio tools, manual runs and admin endpoints. It may call any type, not only `client` ones, so check for it in handlers only developers should reach."},{"module":"ckx_sdk","name":"Caller::Instance","kind":"variant","signature":"Instance(u64)","docs":""},{"module":"ckx_sdk","name":"Caller::Platform","kind":"variant","signature":"Platform","docs":""},{"module":"ckx_sdk","name":"Caller::Player","kind":"variant","signature":"Player(u64)","docs":""},{"module":"ckx_sdk","name":"Ctx","kind":"struct","signature":"pub struct Ctx { pub app: u64, pub instance: u64, pub epoch: u64, /// The deployed code version. pub version: u64, pub kind: Kind, pub node_type: String, pub key: String, }","docs":"This instance's identity and its way out: calls, messages, publishing and the node API."},{"module":"ckx_sdk","name":"Ctx::access","kind":"method","signature":"pub fn access(&self) -> node::Access<'_>","docs":"Players' access to this app: read, grant, revoke, suspend (scopes `access.read`, `access.write`)."},{"module":"ckx_sdk","name":"Ctx::app","kind":"field","signature":"pub app: u64","docs":""},{"module":"ckx_sdk","name":"Ctx::call","kind":"method","signature":"pub fn call(&self, node_type: &str, key: &str, method: &str, payload: &[u8]) -> Result<Vec<u8>, CallError>","docs":"Calls an endpoint on another instance of this app and waits for its reply. This instance handles nothing else until the reply arrives or the deadline passes."},{"module":"ckx_sdk","name":"Ctx::call_typed","kind":"method","signature":"pub fn call_typed<Req: Serialize + ?Sized, Resp: DeserializeOwned>( &self, node_type: &str, key: &str, method: &str, req: &Req, ) -> Result<Resp>","docs":"[`Ctx::call`] with MessagePack encoding on both sides."},{"module":"ckx_sdk","name":"Ctx::call_with_deadline","kind":"method","signature":"pub fn call_with_deadline( &self, node_type: &str, key: &str, method: &str, payload: &[u8], deadline_ms: u32, ) -> Result<Vec<u8>, CallError>","docs":""},{"module":"ckx_sdk","name":"Ctx::cancel_timer","kind":"method","signature":"pub fn cancel_timer(&self, name: &str) -> bool","docs":"Cancels a timer. Returns whether it was set."},{"module":"ckx_sdk","name":"Ctx::emit_actor","kind":"method","signature":"pub fn emit_actor(&self, actor: &[u8; 32], at: node::ChunkPos, distance: u8, state: &[u8]) -> Result<(), CallError>","docs":"Shows a server-driven actor (an NPC, a mob) with `state` to the players near `at`."},{"module":"ckx_sdk","name":"Ctx::emit_channel","kind":"method","signature":"pub fn emit_channel(&self, channel: u64, sender: &[u8; 32], payload: &[u8]) -> Result<(), CallError>","docs":"Sends `payload` to every member of one of the app's channels, as a channel message from `sender`."},{"module":"ckx_sdk","name":"Ctx::emit_spatial","kind":"method","signature":"pub fn emit_spatial(&self, at: node::ChunkPos, distance: u8, actor: &[u8; 32], event: emit::Spatial<'_>) -> Result<(), CallError>","docs":"Sends a spatial event to the players within `distance` chunks of `at` (at most 8), at once, through the realtime tier. `actor` is the event's actor: the actor whose state it is, or the one an [`Spatial::ActorMessage`] is for. See [`emit`]."},{"module":"ckx_sdk","name":"Ctx::epoch","kind":"field","signature":"pub epoch: u64","docs":""},{"module":"ckx_sdk","name":"Ctx::grids","kind":"method","signature":"pub fn grids(&self) -> node::Grids<'_>","docs":"This app's grids and their permissions (scopes `grids.read`, `grids.write`)."},{"module":"ckx_sdk","name":"Ctx::instance","kind":"field","signature":"pub instance: u64","docs":""},{"module":"ckx_sdk","name":"Ctx::key","kind":"field","signature":"pub key: String","docs":""},{"module":"ckx_sdk","name":"Ctx::kind","kind":"field","signature":"pub kind: Kind","docs":""},{"module":"ckx_sdk","name":"Ctx::log","kind":"method","signature":"pub fn log(&self, level: Level, msg: &str)","docs":""},{"module":"ckx_sdk","name":"Ctx::node","kind":"method","signature":"pub fn node(&self, op: &str, payload: &[u8]) -> Result<Vec<u8>, CallError>","docs":"A raw node API request: `op` and a JSON body, answered with JSON. The typed operations behind [`Ctx::world`], [`Ctx::grids`], [`Ctx::players`], [`Ctx::permissions`] and [`Ctx::access`] use it."},{"module":"ckx_sdk","name":"Ctx::node_type","kind":"field","signature":"pub node_type: String","docs":""},{"module":"ckx_sdk","name":"Ctx::now_ms","kind":"method","signature":"pub fn now_ms(&self) -> u64","docs":""},{"module":"ckx_sdk","name":"Ctx::permissions","kind":"method","signature":"pub fn permissions(&self) -> node::Permissions<'_>","docs":"Grants and revokes grid permissions (scope `permissions.write`)."},{"module":"ckx_sdk","name":"Ctx::persist_now","kind":"method","signature":"pub fn persist_now(&self)","docs":"Snapshots this hub soon after the current call returns (at most once a second), for a change that should not wait for the snapshot interval."},{"module":"ckx_sdk","name":"Ctx::players","kind":"method","signature":"pub fn players(&self) -> node::Players<'_>","docs":"Players of this app: identity, tier features, group permissions and app state (scopes `players.read`, `players.write`)."},{"module":"ckx_sdk","name":"Ctx::publish","kind":"method","signature":"pub fn publish(&self, topic: &str, payload: &[u8])","docs":"Pushes `payload` to every subscriber of `topic` on this instance."},{"module":"ckx_sdk","name":"Ctx::send","kind":"method","signature":"pub fn send(&self, node_type: &str, key: &str, method: &str, payload: &[u8]) -> Result<(), CallError>","docs":"Sends a one-way message. Delivery is attempted once; there is no reply."},{"module":"ckx_sdk","name":"Ctx::subscribe","kind":"method","signature":"pub fn subscribe(&self, node_type: &str, key: &str, topic: &str) -> Result<(), CallError>","docs":"Subscribes this hub to `topic` on another instance of the app, if the manifest lets this type call that one. Messages arrive at [`Hub::on_topic`]. The subscription is kept in the snapshot and renewed whenever the hub starts again."},{"module":"ckx_sdk","name":"Ctx::timer_after","kind":"method","signature":"pub fn timer_after(&self, name: &str, delay_ms: u64) -> Result<()>","docs":"Runs [`Hub::on_timer`] with `name` once, `delay_ms` from now, replacing any timer of that name. Timers are kept in the snapshot, so they survive stops and moves; they run only while the hub runs, and one that came due meanwhile runs once when it is back."},{"module":"ckx_sdk","name":"Ctx::timer_every","kind":"method","signature":"pub fn timer_every(&self, name: &str, period_ms: u64) -> Result<()>","docs":"Runs [`Hub::on_timer`] with `name` every `period_ms` (at least 10), the first time one period from now. Replaces any timer of that name."},{"module":"ckx_sdk","name":"Ctx::timers","kind":"method","signature":"pub fn timers(&self) -> Vec<(String, u64)>","docs":"Pending timers and when each is next due, in Unix milliseconds."},{"module":"ckx_sdk","name":"Ctx::unsubscribe","kind":"method","signature":"pub fn unsubscribe(&self, node_type: &str, key: &str, topic: &str) -> Result<(), CallError>","docs":""},{"module":"ckx_sdk","name":"Ctx::version","kind":"field","signature":"pub version: u64","docs":"The deployed code version."},{"module":"ckx_sdk","name":"Ctx::world","kind":"method","signature":"pub fn world(&self) -> node::World<'_>","docs":"Chunks, voxels and actors in this app's world (scopes `world.read`, `world.write`)."},{"module":"ckx_sdk","name":"DEFAULT_DEADLINE_MS","kind":"const","signature":"pub const DEFAULT_DEADLINE_MS: u32 = 2_000;","docs":"Default deadline for calls made without one."},{"module":"ckx_sdk","name":"Error","kind":"struct","signature":"pub struct Error(pub String);","docs":"An error a handler returns. The caller receives its message with status `AppError`."},{"module":"ckx_sdk","name":"Error::fmt","kind":"method","signature":"fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result","docs":""},{"module":"ckx_sdk","name":"Error::from","kind":"method","signature":"fn from(e: CallError) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::from","kind":"method","signature":"fn from(s: &str) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::from","kind":"method","signature":"fn from(s: String) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::new","kind":"method","signature":"pub fn new(msg: impl Into<String>) -> Self","docs":""},{"module":"ckx_sdk","name":"Error::unknown_method","kind":"method","signature":"pub fn unknown_method(method: &str) -> Self","docs":""},{"module":"ckx_sdk","name":"Hub","kind":"trait","signature":"pub trait Hub: Sized + 'static","docs":"A stateful node: one instance per key, one handler at a time."},{"module":"ckx_sdk","name":"Hub::evict","kind":"method","signature":"fn evict(&mut self, _ctx: &Ctx)","docs":"Called once before a graceful stop, after the last persist."},{"module":"ckx_sdk","name":"Hub::handle","kind":"method","signature":"fn handle(&mut self, ctx: &Ctx, call: Call<'_>) -> Result<Vec<u8>>;","docs":""},{"module":"ckx_sdk","name":"Hub::load","kind":"method","signature":"fn load(ctx: &Ctx, snapshot: &[u8], from_version: u64) -> Result<Self>;","docs":"An instance restored from its last snapshot, written by code version `from_version`."},{"module":"ckx_sdk","name":"Hub::on_presence","kind":"method","signature":"fn on_presence(&mut self, _ctx: &Ctx, _presence: &Presence) -> Result<()>","docs":"Root hub only: players entered or left the app."},{"module":"ckx_sdk","name":"Hub::on_session","kind":"method","signature":"fn on_session(&mut self, _ctx: &Ctx, _player: u64, _session: Session) -> Result<()>","docs":"A player's connection subscribed to this hub, or left it."},{"module":"ckx_sdk","name":"Hub::on_timer","kind":"method","signature":"fn on_timer(&mut self, _ctx: &Ctx, _timer: &str) -> Result<()>","docs":"A timer set with [`Ctx::timer_after`] or [`Ctx::timer_every`] is due. An error is logged; the timer stays as scheduled."},{"module":"ckx_sdk","name":"Hub::on_topic","kind":"method","signature":"fn on_topic(&mut self, _ctx: &Ctx, _msg: TopicMsg<'_>) -> Result<()>","docs":"A message on a topic this hub watches."},{"module":"ckx_sdk","name":"Hub::on_world","kind":"method","signature":"fn on_world(&mut self, _ctx: &Ctx, _events: &[WorldEvent]) -> Result<()>","docs":"Mods only: things happened in the mod's grid. An actor arriving starts a mod that is not running, and this is its first call after `spawn` or `load`."},{"module":"ckx_sdk","name":"Hub::persist","kind":"method","signature":"fn persist(&mut self, ctx: &Ctx) -> Result<Vec<u8>>;","docs":"The state to snapshot. Called on the snapshot interval, before a move and before a stop."},{"module":"ckx_sdk","name":"Hub::spawn","kind":"method","signature":"fn spawn(ctx: &Ctx, seed: &[u8]) -> Result<Self>;","docs":"A new instance with no snapshot."},{"module":"ckx_sdk","name":"Kind","kind":"enum","signature":"pub enum Kind { Hub, Spoke, }","docs":""},{"module":"ckx_sdk","name":"Kind::Hub","kind":"variant","signature":"Hub","docs":""},{"module":"ckx_sdk","name":"Kind::Spoke","kind":"variant","signature":"Spoke","docs":""},{"module":"ckx_sdk","name":"Level","kind":"enum","signature":"pub enum Level { Error = 0, Warn = 1, Info = 2, Debug = 3, }","docs":""},{"module":"ckx_sdk","name":"Level::Debug","kind":"variant","signature":"Debug = 3","docs":""},{"module":"ckx_sdk","name":"Level::Error","kind":"variant","signature":"Error = 0","docs":""},{"module":"ckx_sdk","name":"Level::Info","kind":"variant","signature":"Info = 2","docs":""},{"module":"ckx_sdk","name":"Level::Warn","kind":"variant","signature":"Warn = 1","docs":""},{"module":"ckx_sdk","name":"Presence","kind":"struct","signature":"pub struct Presence { /// Players in the app now. pub count: u32, #[serde(default)] pub joined: Vec<PresencePlayer>, #[serde(default)] pub left: Vec<PresencePlayer>, }","docs":"Players who entered or left the app since the last event, or a new count, delivered to the root hub. Events can be lost when the root hub moves; `count` is always current."},{"module":"ckx_sdk","name":"Presence::count","kind":"field","signature":"pub count: u32","docs":"Players in the app now."},{"module":"ckx_sdk","name":"Presence::joined","kind":"field","signature":"pub joined: Vec<PresencePlayer>","docs":""},{"module":"ckx_sdk","name":"Presence::left","kind":"field","signature":"pub left: Vec<PresencePlayer>","docs":""},{"module":"ckx_sdk","name":"PresencePlayer","kind":"struct","signature":"pub struct PresencePlayer { pub player: u64, /// The player's avatar in the world, when they have one. #[serde(default)] pub actor: Option<String>, }","docs":""},{"module":"ckx_sdk","name":"PresencePlayer::actor","kind":"field","signature":"pub actor: Option<String>","docs":"The player's avatar in the world, when they have one."},{"module":"ckx_sdk","name":"PresencePlayer::player","kind":"field","signature":"pub player: u64","docs":""},{"module":"ckx_sdk","name":"Result","kind":"type","signature":"pub type Result<T, E = Error> = std::result::Result<T, E>;","docs":""},{"module":"ckx_sdk","name":"Session","kind":"enum","signature":"pub enum Session { Joined, Left, }","docs":"A player's connection subscribing to a hub's first topic, or leaving its last. A player connected twice joins twice."},{"module":"ckx_sdk","name":"Session::Joined","kind":"variant","signature":"Joined","docs":""},{"module":"ckx_sdk","name":"Session::Left","kind":"variant","signature":"Left","docs":""},{"module":"ckx_sdk","name":"Spoke","kind":"trait","signature":"pub trait Spoke: Sized + 'static","docs":"A stateless node. Replicas may run anywhere; keep nothing here you cannot lose."},{"module":"ckx_sdk","name":"Spoke::handle","kind":"method","signature":"fn handle(&mut self, ctx: &Ctx, call: Call<'_>) -> Result<Vec<u8>>;","docs":""},{"module":"ckx_sdk","name":"Spoke::start","kind":"method","signature":"fn start(ctx: &Ctx) -> Result<Self>;","docs":""},{"module":"ckx_sdk","name":"Status","kind":"enum","signature":"pub enum Status { Ok, AppError, Busy, Moved, NotFound, DeadlineExceeded, Denied, RateLimited, Unavailable, Internal, Trapped, BadRequest, Unknown(u8), }","docs":"The platform's status for a call this instance made. Mirrors the wire status codes."},{"module":"ckx_sdk","name":"Status::AppError","kind":"variant","signature":"AppError","docs":""},{"module":"ckx_sdk","name":"Status::BadRequest","kind":"variant","signature":"BadRequest","docs":""},{"module":"ckx_sdk","name":"Status::Busy","kind":"variant","signature":"Busy","docs":""},{"module":"ckx_sdk","name":"Status::DeadlineExceeded","kind":"variant","signature":"DeadlineExceeded","docs":""},{"module":"ckx_sdk","name":"Status::Denied","kind":"variant","signature":"Denied","docs":""},{"module":"ckx_sdk","name":"Status::Internal","kind":"variant","signature":"Internal","docs":""},{"module":"ckx_sdk","name":"Status::Moved","kind":"variant","signature":"Moved","docs":""},{"module":"ckx_sdk","name":"Status::NotFound","kind":"variant","signature":"NotFound","docs":""},{"module":"ckx_sdk","name":"Status::Ok","kind":"variant","signature":"Ok","docs":""},{"module":"ckx_sdk","name":"Status::RateLimited","kind":"variant","signature":"RateLimited","docs":""},{"module":"ckx_sdk","name":"Status::Trapped","kind":"variant","signature":"Trapped","docs":""},{"module":"ckx_sdk","name":"Status::Unavailable","kind":"variant","signature":"Unavailable","docs":""},{"module":"ckx_sdk","name":"Status::Unknown","kind":"variant","signature":"Unknown(u8)","docs":""},{"module":"ckx_sdk","name":"Status::as_u8","kind":"method","signature":"pub fn as_u8(self) -> u8","docs":"The wire status code: [`Status::from_u8`] reversed."},{"module":"ckx_sdk","name":"Status::from_u8","kind":"method","signature":"pub fn from_u8(v: u8) -> Self","docs":""},{"module":"ckx_sdk","name":"Status::is_retryable","kind":"method","signature":"pub fn is_retryable(self) -> bool","docs":""},{"module":"ckx_sdk","name":"TopicMsg","kind":"struct","signature":"pub struct TopicMsg<'a> { /// The publishing instance's type and key. pub node_type: &'a str, pub key: &'a str, pub topic: &'a str, pub payload: &'a [u8], }","docs":"A message published on a topic this hub watches ([`Ctx::subscribe`])."},{"module":"ckx_sdk","name":"TopicMsg::decode","kind":"method","signature":"pub fn decode<T: DeserializeOwned>(&self) -> Result<T>","docs":""},{"module":"ckx_sdk","name":"TopicMsg::key","kind":"field","signature":"pub key: &'a str","docs":""},{"module":"ckx_sdk","name":"TopicMsg::node_type","kind":"field","signature":"pub node_type: &'a str","docs":"The publishing instance's type and key."},{"module":"ckx_sdk","name":"TopicMsg::payload","kind":"field","signature":"pub payload: &'a [u8]","docs":""},{"module":"ckx_sdk","name":"TopicMsg::topic","kind":"field","signature":"pub topic: &'a str","docs":""},{"module":"ckx_sdk","name":"WorldEvent","kind":"struct","signature":"pub struct WorldEvent { pub grid: u64, /// [`WorldEvent::ACTORS`] or [`WorldEvent::VOXELS`]. pub kind: String, pub chunk: [i64; 3], }","docs":"Something that happened in a mod's grid, delivered to mods only. Events come in batches and can be lost; each names the chunk it happened in."},{"module":"ckx_sdk","name":"WorldEvent::ACTORS","kind":"const","signature":"pub const ACTORS: &'static str = \"actors\";","docs":"Actors moved into or out of the chunk."},{"module":"ckx_sdk","name":"WorldEvent::VOXELS","kind":"const","signature":"pub const VOXELS: &'static str = \"voxels\";","docs":"Voxels in the chunk changed."},{"module":"ckx_sdk","name":"WorldEvent::chunk","kind":"field","signature":"pub chunk: [i64; 3]","docs":""},{"module":"ckx_sdk","name":"WorldEvent::grid","kind":"field","signature":"pub grid: u64","docs":""},{"module":"ckx_sdk","name":"WorldEvent::kind","kind":"field","signature":"pub kind: String","docs":"[`WorldEvent::ACTORS`] or [`WorldEvent::VOXELS`]."},{"module":"ckx_sdk","name":"cron","kind":"module","signature":"pub mod cron;","docs":""},{"module":"ckx_sdk","name":"decode","kind":"function","signature":"pub fn decode<T: DeserializeOwned>(bytes: &[u8]) -> Result<T>","docs":"Decodes MessagePack."},{"module":"ckx_sdk","name":"emit","kind":"module","signature":"pub mod emit;","docs":""},{"module":"ckx_sdk","name":"encode","kind":"function","signature":"pub fn encode<T: Serialize + ?Sized>(value: &T) -> Result<Vec<u8>>","docs":"Encodes a value as MessagePack with named fields."},{"module":"ckx_sdk","name":"export_hub","kind":"macro","signature":"macro_rules! export_hub { ($t:ty) => { $crate::__export_node!($crate::rt::HubNode<$t>); }; }","docs":"Exports a [`Hub`] type as this module's node."},{"module":"ckx_sdk","name":"export_spoke","kind":"macro","signature":"macro_rules! export_spoke { ($t:ty) => { $crate::__export_node!($crate::rt::SpokeNode<$t>); }; }","docs":"Exports a [`Spoke`] type as this module's node."},{"module":"ckx_sdk","name":"kit","kind":"module","signature":"pub mod kit;","docs":""},{"module":"ckx_sdk","name":"limits","kind":"module","signature":"pub mod limits;","docs":""},{"module":"ckx_sdk","name":"model","kind":"module","signature":"pub mod model;","docs":""},{"module":"ckx_sdk","name":"node","kind":"module","signature":"pub mod node;","docs":""},{"module":"ckx_sdk","name":"prelude","kind":"module","signature":"pub mod prelude","docs":""},{"module":"ckx_sdk::cron","name":"Cron","kind":"struct","signature":"pub struct Cron { source: String, seconds: u64, minutes: u64, hours: u32, /// Days of the month, bits 1-31. days: u32, /// `L` in the day of month. last_day: bool, /// Entries in the day-of-month field as legacy counted them, which decides whether it is /// unrestricted. day_entries: usize, /// Months, bits 1-12. months: u16, /// Days of the week, bits 0-6 (Sunday 0). weekdays: u8, /// `nL`: the last such weekday of the month. last_weekdays: u8, weekday_entries: usize, /// `n#k`: only the k-th week of the month (days 7k-6 to 7k); 0 when not given. nth: u8, /// Seconds east of UTC. offset_s: i64, }","docs":"A parsed cron expression. See the [module docs](self) for the syntax."},{"module":"ckx_sdk::cron","name":"Cron::Err","kind":"type","signature":"type Err = CronError;","docs":""},{"module":"ckx_sdk::cron","name":"Cron::fmt","kind":"method","signature":"fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result","docs":""},{"module":"ckx_sdk::cron","name":"Cron::from_str","kind":"method","signature":"fn from_str(s: &str) -> Result<Self, CronError>","docs":""},{"module":"ckx_sdk::cron","name":"Cron::next_after","kind":"method","signature":"pub fn next_after(&self, after_ms: u64) -> Option<u64>","docs":"The first time it fires strictly after `after_ms` (Unix milliseconds), on a whole second; `None` when it never does."},{"module":"ckx_sdk::cron","name":"Cron::parse","kind":"method","signature":"pub fn parse(expr: &str) -> Result<Self, CronError>","docs":"Parses an expression; see the [module docs](self) for what is accepted."},{"module":"ckx_sdk::cron","name":"Cron::with_utc_offset","kind":"method","signature":"pub fn with_utc_offset(mut self, minutes: i32) -> Result<Self, CronError>","docs":"The same schedule in a fixed offset from UTC, in minutes east (`-300` for UTC-5), within ±18 hours. There is no daylight saving: a zone that has it needs a new offset when its clocks change."},{"module":"ckx_sdk::cron","name":"CronError","kind":"struct","signature":"pub struct CronError(pub String);","docs":"Why an expression was refused."},{"module":"ckx_sdk::cron","name":"CronError::fmt","kind":"method","signature":"fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result","docs":""},{"module":"ckx_sdk::cron","name":"Ctx::timer_cron","kind":"method","signature":"pub fn timer_cron(&self, name: &str, cron: &Cron) -> Result<()>","docs":"Runs [`Hub::on_timer`](crate::Hub::on_timer) with `name` at the next time `cron` fires, replacing any timer of that name. Call it again from `on_timer` to keep the schedule."},{"module":"ckx_sdk::cron","name":"Error::from","kind":"method","signature":"fn from(e: CronError) -> Self","docs":""},{"module":"ckx_sdk::emit","name":"MAX_DISTANCE","kind":"const","signature":"pub const MAX_DISTANCE: u8 = 8;","docs":""},{"module":"ckx_sdk::emit","name":"MAX_PAYLOAD","kind":"const","signature":"pub const MAX_PAYLOAD: usize = 1024;","docs":""},{"module":"ckx_sdk::emit","name":"Spatial","kind":"enum","signature":"pub enum Spatial<'a> { /// An actor's state: a server-driven actor appears and moves like a player's. Actor { state: &'a [u8] }, /// A voxel edit at `(x, y, z)` within the chunk, folded into the live mesh. The durable /// write is `ctx.world().set_voxels`, which already shows it; this is for effects. Voxel { x: i16, y: i16, z: i16, voxel_type: i16, state: &'a [u8] }, /// A server event (`event_type`, then `state`), as games route server events. Event { event_type: u16, state: &'a [u8] }, /// An app-defined payload. Generic { payload: &'a [u8] }, /// A message to the one actor named as the event's actor. ActorMessage { payload: &'a [u8] }, }","docs":"What a spatial event is to the players who receive it."},{"module":"ckx_sdk::emit","name":"Spatial::Actor","kind":"variant","signature":"Actor { state: &'a [u8] }","docs":"An actor's state: a server-driven actor appears and moves like a player's."},{"module":"ckx_sdk::emit","name":"Spatial::ActorMessage","kind":"variant","signature":"ActorMessage { payload: &'a [u8] }","docs":"A message to the one actor named as the event's actor."},{"module":"ckx_sdk::emit","name":"Spatial::Event","kind":"variant","signature":"Event { event_type: u16, state: &'a [u8] }","docs":"A server event (`event_type`, then `state`), as games route server events."},{"module":"ckx_sdk::emit","name":"Spatial::Generic","kind":"variant","signature":"Generic { payload: &'a [u8] }","docs":"An app-defined payload."},{"module":"ckx_sdk::emit","name":"Spatial::Voxel","kind":"variant","signature":"Voxel { x: i16, y: i16, z: i16, voxel_type: i16, state: &'a [u8] }","docs":"A voxel edit at `(x, y, z)` within the chunk, folded into the live mesh. The durable write is `ctx.world().set_voxels`, which already shows it; this is for effects."},{"module":"ckx_sdk::emit","name":"actor_id","kind":"function","signature":"pub fn actor_id(uuid: &str) -> [u8; 32]","docs":"A 32-byte actor id, as the realtime tier addresses actors. Players' actors use their 32-character uuid; a server-driven actor (an NPC, a mob) can use any 32 bytes."},{"module":"ckx_sdk::kit","name":"ACTION_ID_MAX","kind":"const","signature":"pub const ACTION_ID_MAX: usize = 64;","docs":"The longest `action_id` a call may carry, in bytes."},{"module":"ckx_sdk::kit","name":"Changed","kind":"struct","signature":"pub struct Changed { /// The players who should read again. pub who: Vec<u64>, /// What changed for them, as the hub's endpoints name it. pub what: String, }","docs":"The body of a `changed` message."},{"module":"ckx_sdk::kit","name":"Changed::what","kind":"field","signature":"pub what: String","docs":"What changed for them, as the hub's endpoints name it."},{"module":"ckx_sdk::kit","name":"Changed::who","kind":"field","signature":"pub who: Vec<u64>","docs":"The players who should read again."},{"module":"ckx_sdk::kit","name":"Containers","kind":"struct","signature":"pub struct Containers { pub containers: Vec<Published>, }","docs":"The body of a collection's snapshot: every member as a `delta` would show it."},{"module":"ckx_sdk::kit","name":"Containers::containers","kind":"field","signature":"pub containers: Vec<Published>","docs":""},{"module":"ckx_sdk::kit","name":"Header","kind":"struct","signature":"pub struct Header { pub v: u8, pub epoch: u64, pub seq: u64, pub kind: MessageKind, }","docs":"The reserved fields of every kit message."},{"module":"ckx_sdk::kit","name":"Header::epoch","kind":"field","signature":"pub epoch: u64","docs":""},{"module":"ckx_sdk::kit","name":"Header::kind","kind":"field","signature":"pub kind: MessageKind","docs":""},{"module":"ckx_sdk::kit","name":"Header::seq","kind":"field","signature":"pub seq: u64","docs":""},{"module":"ckx_sdk::kit","name":"Header::v","kind":"field","signature":"pub v: u8","docs":""},{"module":"ckx_sdk::kit","name":"Message","kind":"struct","signature":"pub struct Message<T> { #[serde(flatten)] pub header: Header, #[serde(flatten)] pub body: T, }","docs":"A kit message as it is read back: its header, and the body's own fields beside it."},{"module":"ckx_sdk::kit","name":"Message::body","kind":"field","signature":"pub body: T","docs":""},{"module":"ckx_sdk::kit","name":"Message::header","kind":"field","signature":"pub header: Header","docs":""},{"module":"ckx_sdk::kit","name":"MessageKind","kind":"enum","signature":"pub enum MessageKind { Snapshot, Delta, Changed, Event, }","docs":"What a [`Message`] is."},{"module":"ckx_sdk::kit","name":"MessageKind::Changed","kind":"variant","signature":"Changed","docs":""},{"module":"ckx_sdk::kit","name":"MessageKind::Delta","kind":"variant","signature":"Delta","docs":""},{"module":"ckx_sdk::kit","name":"MessageKind::Event","kind":"variant","signature":"Event","docs":""},{"module":"ckx_sdk::kit","name":"MessageKind::Snapshot","kind":"variant","signature":"Snapshot","docs":""},{"module":"ckx_sdk::kit","name":"PROTOCOL","kind":"const","signature":"pub const PROTOCOL: u8 = 1;","docs":"The protocol version kit messages carry in `v`."},{"module":"ckx_sdk::kit","name":"Publisher","kind":"struct","signature":"pub struct Publisher { #[serde(default)] seqs: BTreeMap<String, u64>, }","docs":"A hub's topics and how far each has got. Keep it in the hub's state, so `seq` carries on after a snapshot; a client that sees another `epoch` asks for a snapshot again anyway."},{"module":"ckx_sdk::kit","name":"Publisher::changed","kind":"method","signature":"pub fn changed(&mut self, ctx: &Ctx, topic: &str, who: &[u64], what: &str) -> Result<()>","docs":"Tells `who` that `what` changed for them; nothing private goes on the topic. Does nothing when `who` is empty."},{"module":"ckx_sdk::kit","name":"Publisher::delta","kind":"method","signature":"pub fn delta<T: Serialize + ?Sized>(&mut self, ctx: &Ctx, topic: &str, body: &T) -> Result<()>","docs":"Publishes one change to the topic's collection."},{"module":"ckx_sdk::kit","name":"Publisher::event","kind":"method","signature":"pub fn event<T: Serialize + ?Sized>(&mut self, ctx: &Ctx, topic: &str, body: &T) -> Result<()>","docs":"Publishes something that happened."},{"module":"ckx_sdk::kit","name":"Publisher::model_changes","kind":"method","signature":"pub fn model_changes(&mut self, ctx: &Ctx, model: &mut Model, schema: &Schema, topic: &str) -> Result<usize>","docs":"Publishes the model's public changes since the last call ([`Model::public_changes`]) as deltas on `topic`, one container each, and returns how many went out. Owner and hidden properties are never published."},{"module":"ckx_sdk::kit","name":"Publisher::model_snapshot_reply","kind":"method","signature":"pub fn model_snapshot_reply(&self, ctx: &Ctx, model: &Model, schema: &Schema, topic: &str) -> Result<Vec<u8>>","docs":"The reply to [`SNAPSHOT_METHOD`] for a topic [`Publisher::model_changes`] feeds: every container's public view, as [`Containers`]."},{"module":"ckx_sdk::kit","name":"Publisher::new","kind":"method","signature":"pub fn new() -> Self","docs":""},{"module":"ckx_sdk::kit","name":"Publisher::publish","kind":"method","signature":"pub fn publish<T: Serialize + ?Sized>(&mut self, ctx: &Ctx, topic: &str, kind: MessageKind, body: &T) -> Result<()>","docs":"Publishes one message on `topic`."},{"module":"ckx_sdk::kit","name":"Publisher::seq","kind":"method","signature":"pub fn seq(&self, topic: &str) -> u64","docs":"The topic's last `seq`; 0 before its first message."},{"module":"ckx_sdk::kit","name":"Publisher::snapshot","kind":"method","signature":"pub fn snapshot<T: Serialize + ?Sized>(&mut self, ctx: &Ctx, topic: &str, body: &T) -> Result<()>","docs":"Publishes the topic's whole state."},{"module":"ckx_sdk::kit","name":"Publisher::snapshot_reply","kind":"method","signature":"pub fn snapshot_reply<T: Serialize + ?Sized>(&self, ctx: &Ctx, topic: &str, body: &T) -> Result<Vec<u8>>","docs":"The reply to [`SNAPSHOT_METHOD`] for `topic`: its state now, at its last `seq`."},{"module":"ckx_sdk::kit","name":"RECEIPTS_MAX","kind":"const","signature":"pub const RECEIPTS_MAX: usize = 256;","docs":"Receipts a hub keeps at most; the oldest go first."},{"module":"ckx_sdk::kit","name":"RECEIPT_REPLY_MAX","kind":"const","signature":"pub const RECEIPT_REPLY_MAX: usize = 1024;","docs":"The largest reply a receipt keeps. A call sent again whose first reply was larger is refused with [`codes::ALREADY_DONE`]: it ran, and the hub's state has its result."},{"module":"ckx_sdk::kit","name":"RECEIPT_TTL_MS","kind":"const","signature":"pub const RECEIPT_TTL_MS: u64 = 10 * 60 * 1000;","docs":"How long a receipt is kept."},{"module":"ckx_sdk::kit","name":"Receipts","kind":"struct","signature":"pub struct Receipts { #[serde(default)] kept: VecDeque<Receipt>, }","docs":"What each caller's recent actions were answered, by `action_id`. Keep it in the hub's state: an action sent again after the hub restarted from its last snapshot is answered from it, if that snapshot came after the action."},{"module":"ckx_sdk::kit","name":"Receipts::action_id","kind":"method","signature":"pub fn action_id(payload: &[u8]) -> Result<Option<String>>","docs":"The `action_id` a call's arguments carry: a map's `action_id` string. `None` when the arguments are not a map or carry none; refused when it is empty or too long."},{"module":"ckx_sdk::kit","name":"Receipts::is_empty","kind":"method","signature":"pub fn is_empty(&self) -> bool","docs":""},{"module":"ckx_sdk::kit","name":"Receipts::len","kind":"method","signature":"pub fn len(&self) -> usize","docs":"How many receipts are kept."},{"module":"ckx_sdk::kit","name":"Receipts::new","kind":"method","signature":"pub fn new() -> Self","docs":""},{"module":"ckx_sdk::kit","name":"Receipts::record","kind":"method","signature":"pub fn record(&mut self, caller: Caller, action_id: Option<&str>, result: &Result<Vec<u8>>, now: u64)","docs":"Keeps what `caller` got for `action_id`; nothing without an action id."},{"module":"ckx_sdk::kit","name":"Receipts::replay","kind":"method","signature":"pub fn replay(&self, caller: Caller, action_id: Option<&str>, now: u64) -> Option<Result<Vec<u8>>>","docs":"The answer `caller` got for `action_id`, if it is kept."},{"module":"ckx_sdk::kit","name":"Receipts::run","kind":"method","signature":"pub fn run<H>( hub: &mut H, receipts: fn(&mut H) -> &mut Receipts, call: &Call<'_>, now: u64, act: impl FnOnce(&mut H) -> Result<Vec<u8>>, ) -> Result<Vec<u8>>","docs":"Runs `act` on `hub` once per (caller, `action_id`): a call sent again gets the first answer. `receipts` finds the hub's receipts; a call without an action id just runs."},{"module":"ckx_sdk::kit","name":"Rng","kind":"reexport","signature":"pub use rng::Rng;","docs":""},{"module":"ckx_sdk::kit","name":"SNAPSHOT_METHOD","kind":"const","signature":"pub const SNAPSHOT_METHOD: &str = \"snapshot\";","docs":"The method every kit hub answers with a topic's snapshot."},{"module":"ckx_sdk::kit","name":"args","kind":"function","signature":"pub fn args<T: DeserializeOwned>(call: &Call<'_>) -> Result<T>","docs":"A call's arguments, refused with [`codes::BAD_REQUEST`] when they do not decode."},{"module":"ckx_sdk::kit","name":"codes","kind":"module","signature":"pub mod codes","docs":"The refusal codes kit hubs share. A hub may add its own: lowercase letters, digits and `_`."},{"module":"ckx_sdk::kit","name":"error","kind":"function","signature":"pub fn error(code: &str, text: impl std::fmt::Display) -> Error","docs":"A refusal with a code: its message is `kit:<code>: <text>`."},{"module":"ckx_sdk::kit","name":"error_code","kind":"function","signature":"pub fn error_code(message: &str) -> Option<(&str, &str)>","docs":"The code and text of a refusal [`error`] made, or `None` for any other message."},{"module":"ckx_sdk::kit","name":"message","kind":"function","signature":"pub fn message<T: Serialize + ?Sized>(ctx: &Ctx, kind: MessageKind, seq: u64, body: &T) -> Result<Vec<u8>>","docs":"Encodes one kit message from this instance. `body` must serialize as a struct or a map."},{"module":"ckx_sdk::kit","name":"public_containers","kind":"function","signature":"pub fn public_containers(model: &Model, schema: &Schema) -> Result<Containers>","docs":"Every container's public view, as a collection snapshot carries it."},{"module":"ckx_sdk::kit","name":"rng","kind":"module","signature":"pub mod rng;","docs":""},{"module":"ckx_sdk::kit","name":"shard","kind":"module","signature":"pub mod shard;","docs":""},{"module":"ckx_sdk::kit","name":"snapshot_topic","kind":"function","signature":"pub fn snapshot_topic(call: &Call<'_>, default: &str) -> String","docs":"The `topic` a [`SNAPSHOT_METHOD`] call names, or `default` when it names none."},{"module":"ckx_sdk::kit","name":"wire","kind":"module","signature":"pub mod wire;","docs":""},{"module":"ckx_sdk::kit::codes","name":"ALREADY_DONE","kind":"const","signature":"pub const ALREADY_DONE: &str = \"already_done\";","docs":"The action already ran; its reply was too large to keep ([`super::RECEIPT_REPLY_MAX`])."},{"module":"ckx_sdk::kit::codes","name":"BAD_REQUEST","kind":"const","signature":"pub const BAD_REQUEST: &str = \"bad_request\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"CONFLICT","kind":"const","signature":"pub const CONFLICT: &str = \"conflict\";","docs":"The state does not allow it now."},{"module":"ckx_sdk::kit::codes","name":"COOLDOWN","kind":"const","signature":"pub const COOLDOWN: &str = \"cooldown\";","docs":"Too soon after the last time."},{"module":"ckx_sdk::kit::codes","name":"EMPTY","kind":"const","signature":"pub const EMPTY: &str = \"empty\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"EXPIRED","kind":"const","signature":"pub const EXPIRED: &str = \"expired\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"FINISHED","kind":"const","signature":"pub const FINISHED: &str = \"finished\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"FORBIDDEN","kind":"const","signature":"pub const FORBIDDEN: &str = \"forbidden\";","docs":"The caller may not do this."},{"module":"ckx_sdk::kit::codes","name":"FULL","kind":"const","signature":"pub const FULL: &str = \"full\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"INSUFFICIENT","kind":"const","signature":"pub const INSUFFICIENT: &str = \"insufficient\";","docs":"Not enough of something the caller spends."},{"module":"ckx_sdk::kit::codes","name":"LIMIT","kind":"const","signature":"pub const LIMIT: &str = \"limit\";","docs":"A bound the hub keeps (how many, how large)."},{"module":"ckx_sdk::kit::codes","name":"NOT_FOUND","kind":"const","signature":"pub const NOT_FOUND: &str = \"not_found\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"NOT_MEMBER","kind":"const","signature":"pub const NOT_MEMBER: &str = \"not_member\";","docs":"The caller has not joined."},{"module":"ckx_sdk::kit::codes","name":"NOT_READY","kind":"const","signature":"pub const NOT_READY: &str = \"not_ready\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"NOT_YOUR_TURN","kind":"const","signature":"pub const NOT_YOUR_TURN: &str = \"not_your_turn\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"OUT_OF_REACH","kind":"const","signature":"pub const OUT_OF_REACH: &str = \"out_of_reach\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"RESERVED","kind":"const","signature":"pub const RESERVED: &str = \"reserved\";","docs":""},{"module":"ckx_sdk::kit::codes","name":"STARTED","kind":"const","signature":"pub const STARTED: &str = \"started\";","docs":""},{"module":"ckx_sdk::kit::rng","name":"Rng","kind":"struct","signature":"pub struct Rng { state: u64, }","docs":""},{"module":"ckx_sdk::kit::rng","name":"Rng::below","kind":"method","signature":"pub fn below(&mut self, n: u64) -> u64","docs":"Uniform in `[0, n)`; 0 when `n` is 0."},{"module":"ckx_sdk::kit::rng","name":"Rng::chance","kind":"method","signature":"pub fn chance(&mut self, p: f64) -> bool","docs":"True with probability `p` (clamped to `[0, 1]`)."},{"module":"ckx_sdk::kit::rng","name":"Rng::default","kind":"method","signature":"fn default() -> Self","docs":""},{"module":"ckx_sdk::kit::rng","name":"Rng::f64","kind":"method","signature":"pub fn f64(&mut self) -> f64","docs":"Uniform in `[0, 1)`."},{"module":"ckx_sdk::kit::rng","name":"Rng::next_u64","kind":"method","signature":"pub fn next_u64(&mut self) -> u64","docs":""},{"module":"ckx_sdk::kit::rng","name":"Rng::pick","kind":"method","signature":"pub fn pick<'a, T>(&mut self, items: &'a [T]) -> Option<&'a T>","docs":""},{"module":"ckx_sdk::kit::rng","name":"Rng::range","kind":"method","signature":"pub fn range(&mut self, lo: i64, hi: i64) -> i64","docs":"Uniform in `[lo, hi]`, both included; `lo` when `hi` is not above it."},{"module":"ckx_sdk::kit::rng","name":"Rng::seed_from","kind":"method","signature":"pub fn seed_from(text: &str) -> u64","docs":"A seed from text: a key, a name."},{"module":"ckx_sdk::kit::rng","name":"Rng::seeded","kind":"method","signature":"pub fn seeded(seed: u64) -> Self","docs":"A generator seeded with `seed`; 0 counts as 1, which xorshift needs."},{"module":"ckx_sdk::kit::rng","name":"Rng::shuffle","kind":"method","signature":"pub fn shuffle<T>(&mut self, items: &mut [T])","docs":"Shuffles in place (Fisher-Yates)."},{"module":"ckx_sdk::kit::rng","name":"Rng::weighted","kind":"method","signature":"pub fn weighted(&mut self, weights: &[u64]) -> Option<usize>","docs":"The index of one weight, chosen in proportion to the weights; `None` when they sum to nothing."},{"module":"ckx_sdk::kit::shard","name":"around","kind":"function","signature":"pub fn around(x: i64, z: i64, size: i64, radius: i64) -> Vec<String>","docs":"The keys of the shards within `radius` shards of the one holding `(x, z)`, its own first, then row by row."},{"module":"ckx_sdk::kit::shard","name":"centre","kind":"function","signature":"pub fn centre(x: i64, z: i64, size: i64) -> (i64, i64)","docs":"The shard's centre chunk for chunk `(x, z)`. `size` is at least 1."},{"module":"ckx_sdk::kit::shard","name":"key","kind":"function","signature":"pub fn key(x: i64, z: i64, size: i64) -> String","docs":"The key of the shard that holds chunk `(x, z)`."},{"module":"ckx_sdk::kit::shard","name":"parse","kind":"function","signature":"pub fn parse(key: &str) -> Option<(i64, i64)>","docs":"The centre chunk a key names, or `None` when it is not `\"<x>,<z>\"`."},{"module":"ckx_sdk::kit::wire","name":"ABILITY","kind":"const","signature":"pub const ABILITY: u16 = 94;","docs":"An ability was cast, or landed."},{"module":"ckx_sdk::kit::wire","name":"APP_EVENTS","kind":"const","signature":"pub const APP_EVENTS: u16 = 1000;","docs":"The first number an app's own events may use."},{"module":"ckx_sdk::kit::wire","name":"AbilityUse","kind":"struct","signature":"pub struct AbilityUse { /// `cast` or `impact`. pub kind: String, pub ability_id: String, pub caster_id: String, pub victim_id: Option<String>, pub damage: i64, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"AbilityUse::ability_id","kind":"field","signature":"pub ability_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"AbilityUse::caster_id","kind":"field","signature":"pub caster_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"AbilityUse::damage","kind":"field","signature":"pub damage: i64","docs":""},{"module":"ckx_sdk::kit::wire","name":"AbilityUse::kind","kind":"field","signature":"pub kind: String","docs":"`cast` or `impact`."},{"module":"ckx_sdk::kit::wire","name":"AbilityUse::victim_id","kind":"field","signature":"pub victim_id: Option<String>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ActorState","kind":"struct","signature":"pub struct ActorState { /// What it is: `mob`, `npc`, `pet`, `ball`, `ghost`, a game's own word. pub kind: String, /// Its id within the hub that shows it. pub id: u64, /// Where it is, in chunks. pub x: f64, #[serde(default)] pub y: f64, pub z: f64, /// Its health, when it has any. pub hp: Option<i64>, #[serde(default, skip_serializing_if = \"Option::is_none\")] pub max_hp: Option<i64>, /// What it is doing: `idle`, `chase`, `follow`, ... #[serde(default, skip_serializing_if = \"Option::is_none\")] pub mode: Option<String>, /// The player it belongs to (a pet, a summon). #[serde(default, skip_serializing_if = \"Option::is_none\")] pub owner: Option<u64>, /// Facing, in radians. #[serde(default, skip_serializing_if = \"Option::is_none\")] pub yaw: Option<f64>, #[serde(default, skip_serializing_if = \"Option::is_none\")] pub name: Option<String>, }","docs":"A server-driven actor as players near it see it."},{"module":"ckx_sdk::kit::wire","name":"ActorState::chunk","kind":"method","signature":"pub fn chunk(&self) -> ChunkPos","docs":"The chunk it stands in."},{"module":"ckx_sdk::kit::wire","name":"ActorState::hp","kind":"field","signature":"pub hp: Option<i64>","docs":"Its health, when it has any."},{"module":"ckx_sdk::kit::wire","name":"ActorState::id","kind":"field","signature":"pub id: u64","docs":"Its id within the hub that shows it."},{"module":"ckx_sdk::kit::wire","name":"ActorState::kind","kind":"field","signature":"pub kind: String","docs":"What it is: `mob`, `npc`, `pet`, `ball`, `ghost`, a game's own word."},{"module":"ckx_sdk::kit::wire","name":"ActorState::max_hp","kind":"field","signature":"pub max_hp: Option<i64>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ActorState::mode","kind":"field","signature":"pub mode: Option<String>","docs":"What it is doing: `idle`, `chase`, `follow`, ..."},{"module":"ckx_sdk::kit::wire","name":"ActorState::name","kind":"field","signature":"pub name: Option<String>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ActorState::new","kind":"method","signature":"pub fn new(kind: &str, id: u64, x: f64, z: f64) -> Self","docs":""},{"module":"ckx_sdk::kit::wire","name":"ActorState::owner","kind":"field","signature":"pub owner: Option<u64>","docs":"The player it belongs to (a pet, a summon)."},{"module":"ckx_sdk::kit::wire","name":"ActorState::x","kind":"field","signature":"pub x: f64","docs":"Where it is, in chunks."},{"module":"ckx_sdk::kit::wire","name":"ActorState::y","kind":"field","signature":"pub y: f64","docs":""},{"module":"ckx_sdk::kit::wire","name":"ActorState::yaw","kind":"field","signature":"pub yaw: Option<f64>","docs":"Facing, in radians."},{"module":"ckx_sdk::kit::wire","name":"ActorState::z","kind":"field","signature":"pub z: f64","docs":""},{"module":"ckx_sdk::kit::wire","name":"CONTACT_DAMAGE","kind":"const","signature":"pub const CONTACT_DAMAGE: u16 = 77;","docs":"A mob or a trap hit a player."},{"module":"ckx_sdk::kit::wire","name":"CONTROL_POINT","kind":"const","signature":"pub const CONTROL_POINT: u16 = 96;","docs":"A control point changed hands, or its capture moved."},{"module":"ckx_sdk::kit::wire","name":"ContactDamage","kind":"struct","signature":"pub struct ContactDamage { pub target_uuid: String, pub damage: i64, pub mob_id: String, pub mob_name: String, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"ContactDamage::damage","kind":"field","signature":"pub damage: i64","docs":""},{"module":"ckx_sdk::kit::wire","name":"ContactDamage::mob_id","kind":"field","signature":"pub mob_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ContactDamage::mob_name","kind":"field","signature":"pub mob_name: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ContactDamage::target_uuid","kind":"field","signature":"pub target_uuid: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ControlPointChange","kind":"struct","signature":"pub struct ControlPointChange { pub point_id: String, pub owner: String, pub previous_owner: String, /// Capture progress toward the attacker, 0 to 1. pub progress: f64, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"ControlPointChange::owner","kind":"field","signature":"pub owner: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ControlPointChange::point_id","kind":"field","signature":"pub point_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ControlPointChange::previous_owner","kind":"field","signature":"pub previous_owner: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ControlPointChange::progress","kind":"field","signature":"pub progress: f64","docs":"Capture progress toward the attacker, 0 to 1."},{"module":"ckx_sdk::kit::wire","name":"EMOTE","kind":"const","signature":"pub const EMOTE: u16 = 101;","docs":"An emote: a client event players send each other (the kit clients' convention); a hub may send one too, for a server-driven actor."},{"module":"ckx_sdk::kit::wire","name":"ENCOUNTER","kind":"const","signature":"pub const ENCOUNTER: u16 = 99;","docs":"A wave began or ended, or a boss changed phase."},{"module":"ckx_sdk::kit::wire","name":"Emote","kind":"struct","signature":"pub struct Emote { /// The emote's name, as the game knows it: `wave`, `cheer`, ... pub emote: String, /// The actor it is aimed at, if any. pub target_uuid: Option<String>, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"Emote::emote","kind":"field","signature":"pub emote: String","docs":"The emote's name, as the game knows it: `wave`, `cheer`, ..."},{"module":"ckx_sdk::kit::wire","name":"Emote::target_uuid","kind":"field","signature":"pub target_uuid: Option<String>","docs":"The actor it is aimed at, if any."},{"module":"ckx_sdk::kit::wire","name":"EncounterChange","kind":"struct","signature":"pub struct EncounterChange { /// `wave_started`, `wave_cleared`, `boss_phase` or `finished`. pub kind: String, pub encounter_id: String, pub wave: u32, pub phase: u32, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"EncounterChange::encounter_id","kind":"field","signature":"pub encounter_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"EncounterChange::kind","kind":"field","signature":"pub kind: String","docs":"`wave_started`, `wave_cleared`, `boss_phase` or `finished`."},{"module":"ckx_sdk::kit::wire","name":"EncounterChange::phase","kind":"field","signature":"pub phase: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"EncounterChange::wave","kind":"field","signature":"pub wave: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"MOVEMENT_VIOLATION","kind":"const","signature":"pub const MOVEMENT_VIOLATION: u16 = 95;","docs":"A movement the warden flagged."},{"module":"ckx_sdk::kit::wire","name":"MovementViolation","kind":"struct","signature":"pub struct MovementViolation { /// `speed`, `teleport` or `bounds`. pub kind: String, pub user_id: String, pub detail: String, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"MovementViolation::detail","kind":"field","signature":"pub detail: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"MovementViolation::kind","kind":"field","signature":"pub kind: String","docs":"`speed`, `teleport` or `bounds`."},{"module":"ckx_sdk::kit::wire","name":"MovementViolation::user_id","kind":"field","signature":"pub user_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"POSSESSION","kind":"const","signature":"pub const POSSESSION: u16 = 100;","docs":"The contested object (a ball) changed hands, or a goal was scored."},{"module":"ckx_sdk::kit::wire","name":"PROPOSAL","kind":"const","signature":"pub const PROPOSAL: u16 = 93;","docs":"A match was proposed to the players in it."},{"module":"ckx_sdk::kit::wire","name":"PossessionChange","kind":"struct","signature":"pub struct PossessionChange { /// `claimed`, `passed`, `loose` or `goal`. pub kind: String, pub holder_id: Option<String>, pub team: Option<String>, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"PossessionChange::holder_id","kind":"field","signature":"pub holder_id: Option<String>","docs":""},{"module":"ckx_sdk::kit::wire","name":"PossessionChange::kind","kind":"field","signature":"pub kind: String","docs":"`claimed`, `passed`, `loose` or `goal`."},{"module":"ckx_sdk::kit::wire","name":"PossessionChange::team","kind":"field","signature":"pub team: Option<String>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ProposalMade","kind":"struct","signature":"pub struct ProposalMade { pub proposal_id: String, pub mode: String, pub players: Vec<String>, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"ProposalMade::mode","kind":"field","signature":"pub mode: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ProposalMade::players","kind":"field","signature":"pub players: Vec<String>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ProposalMade::proposal_id","kind":"field","signature":"pub proposal_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"RACE_TIMING","kind":"const","signature":"pub const RACE_TIMING: u16 = 97;","docs":"A racer started, passed a checkpoint, finished a lap or the race."},{"module":"ckx_sdk::kit::wire","name":"RaceTiming","kind":"struct","signature":"pub struct RaceTiming { /// `started`, `checkpoint`, `lap` or `finished`. pub kind: String, pub course_id: String, pub user_id: String, pub checkpoint: u32, pub lap: u32, pub elapsed_ms: u64, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"RaceTiming::checkpoint","kind":"field","signature":"pub checkpoint: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"RaceTiming::course_id","kind":"field","signature":"pub course_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"RaceTiming::elapsed_ms","kind":"field","signature":"pub elapsed_ms: u64","docs":""},{"module":"ckx_sdk::kit::wire","name":"RaceTiming::kind","kind":"field","signature":"pub kind: String","docs":"`started`, `checkpoint`, `lap` or `finished`."},{"module":"ckx_sdk::kit::wire","name":"RaceTiming::lap","kind":"field","signature":"pub lap: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"RaceTiming::user_id","kind":"field","signature":"pub user_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"SCORE","kind":"const","signature":"pub const SCORE: u16 = 92;","docs":"Scores or a result."},{"module":"ckx_sdk::kit::wire","name":"ScoreUpdate","kind":"struct","signature":"pub struct ScoreUpdate { pub standings: Vec<Standing>, pub winner_id: Option<String>, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"ScoreUpdate::standings","kind":"field","signature":"pub standings: Vec<Standing>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ScoreUpdate::winner_id","kind":"field","signature":"pub winner_id: Option<String>","docs":""},{"module":"ckx_sdk::kit::wire","name":"Standing","kind":"struct","signature":"pub struct Standing { pub actor_id: String, pub score: i64, pub rank: u32, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"Standing::actor_id","kind":"field","signature":"pub actor_id: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"Standing::rank","kind":"field","signature":"pub rank: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"Standing::score","kind":"field","signature":"pub score: i64","docs":""},{"module":"ckx_sdk::kit::wire","name":"TURN","kind":"const","signature":"pub const TURN: u16 = 91;","docs":"A turn passed to the next player."},{"module":"ckx_sdk::kit::wire","name":"TurnChange","kind":"struct","signature":"pub struct TurnChange { /// Whose turn it is now: a player id, or a unit's id. pub actor_id: String, pub round: u32, pub turn_in_round: u32, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"TurnChange::actor_id","kind":"field","signature":"pub actor_id: String","docs":"Whose turn it is now: a player id, or a unit's id."},{"module":"ckx_sdk::kit::wire","name":"TurnChange::round","kind":"field","signature":"pub round: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"TurnChange::turn_in_round","kind":"field","signature":"pub turn_in_round: u32","docs":""},{"module":"ckx_sdk::kit::wire","name":"WEATHER","kind":"const","signature":"pub const WEATHER: u16 = 90;","docs":"The weather or the time of day turned."},{"module":"ckx_sdk::kit::wire","name":"WeatherChange","kind":"struct","signature":"pub struct WeatherChange { pub weather: String, pub since_ms: u64, pub until_ms: u64, pub night: bool, pub time_of_day: f64, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"WeatherChange::night","kind":"field","signature":"pub night: bool","docs":""},{"module":"ckx_sdk::kit::wire","name":"WeatherChange::since_ms","kind":"field","signature":"pub since_ms: u64","docs":""},{"module":"ckx_sdk::kit::wire","name":"WeatherChange::time_of_day","kind":"field","signature":"pub time_of_day: f64","docs":""},{"module":"ckx_sdk::kit::wire","name":"WeatherChange::until_ms","kind":"field","signature":"pub until_ms: u64","docs":""},{"module":"ckx_sdk::kit::wire","name":"WeatherChange::weather","kind":"field","signature":"pub weather: String","docs":""},{"module":"ckx_sdk::kit::wire","name":"ZONE_CHANGE","kind":"const","signature":"pub const ZONE_CHANGE: u16 = 98;","docs":"A play zone moved or shrank."},{"module":"ckx_sdk::kit::wire","name":"ZoneChange","kind":"struct","signature":"pub struct ZoneChange { /// `hold`, `shrink` or `closed`. pub kind: String, pub phase: Option<u32>, pub radius_now: f64, pub center_x: f64, pub center_z: f64, }","docs":""},{"module":"ckx_sdk::kit::wire","name":"ZoneChange::center_x","kind":"field","signature":"pub center_x: f64","docs":""},{"module":"ckx_sdk::kit::wire","name":"ZoneChange::center_z","kind":"field","signature":"pub center_z: f64","docs":""},{"module":"ckx_sdk::kit::wire","name":"ZoneChange::kind","kind":"field","signature":"pub kind: String","docs":"`hold`, `shrink` or `closed`."},{"module":"ckx_sdk::kit::wire","name":"ZoneChange::phase","kind":"field","signature":"pub phase: Option<u32>","docs":""},{"module":"ckx_sdk::kit::wire","name":"ZoneChange::radius_now","kind":"field","signature":"pub radius_now: f64","docs":""},{"module":"ckx_sdk::kit::wire","name":"emit_actor_state","kind":"function","signature":"pub fn emit_actor_state(ctx: &Ctx, actor: &[u8; 32], distance: u8, state: &ActorState) -> Result<()>","docs":"Shows a server-driven actor to the players within `distance` chunks of where it stands."},{"module":"ckx_sdk::kit::wire","name":"emit_event","kind":"function","signature":"pub fn emit_event<T: Serialize + ?Sized>(ctx: &Ctx, at: ChunkPos, distance: u8, actor: &[u8; 32], event_type: u16, body: &T) -> Result<()>","docs":"Sends a server event to the players within `distance` chunks of `at` (at most [`MAX_DISTANCE`]). `actor` is the event's actor: the one it is about, or the hub's own."},{"module":"ckx_sdk::kit::wire","name":"event_bytes","kind":"function","signature":"pub fn event_bytes<T: Serialize + ?Sized>(event_type: u16, body: &T) -> Result<Vec<u8>>","docs":"A server event's payload: its type, then its body as JSON."},{"module":"ckx_sdk::limits","name":"ARTIFACT_MAX_BYTES","kind":"const","signature":"pub const ARTIFACT_MAX_BYTES: usize = 16 << 20;","docs":"The largest module an app's node type may deploy."},{"module":"ckx_sdk::limits","name":"LOGS_PER_CALL","kind":"const","signature":"pub const LOGS_PER_CALL: u32 = 32;","docs":"Log lines one call may write (the rest are dropped), and the bytes of a line that are kept."},{"module":"ckx_sdk::limits","name":"MAX_EMIT_BYTES","kind":"const","signature":"pub const MAX_EMIT_BYTES: usize = 70 + crate::emit::MAX_PAYLOAD;","docs":"The largest realtime inject a node may emit: a spatial event's header and its payload."},{"module":"ckx_sdk::limits","name":"MAX_LOG_BYTES","kind":"const","signature":"pub const MAX_LOG_BYTES: usize = 4 << 10;","docs":""},{"module":"ckx_sdk::limits","name":"MAX_PAYLOAD","kind":"const","signature":"pub const MAX_PAYLOAD: usize = 4 << 20;","docs":"The largest payload a node may send in one message, and the largest reply it may return. A larger reply is answered `Internal`."},{"module":"ckx_sdk::limits","name":"MAX_SNAPSHOT_BYTES","kind":"const","signature":"pub const MAX_SNAPSHOT_BYTES: usize = 8 << 20;","docs":"The largest snapshot a hub may persist. A larger one fails to save, and the last one stands."},{"module":"ckx_sdk::limits","name":"OUT_BYTES_PER_CALL","kind":"const","signature":"pub const OUT_BYTES_PER_CALL: u64 = 32 << 20;","docs":""},{"module":"ckx_sdk::limits","name":"OUT_MSGS_PER_CALL","kind":"const","signature":"pub const OUT_MSGS_PER_CALL: u32 = 16_384;","docs":"What one call into a node may send on, in all: messages (calls, sends, publishes, emits, node API requests, subscriptions) and bytes of their payloads. Past either, calls and node API requests answer `Busy` and publishes are dropped."},{"module":"ckx_sdk::limits","name":"crate::node::{MAX_CHUNK_STATE, MAX_VOXEL_STATE, MAX_VOXEL_WRITES}","kind":"reexport","signature":"pub use crate::node::{MAX_CHUNK_STATE, MAX_VOXEL_STATE, MAX_VOXEL_WRITES};","docs":""},{"module":"ckx_sdk::limits","name":"crate::rt::{MAX_TIMERS, MAX_WATCHES, MIN_TIMER_MS}","kind":"reexport","signature":"pub use crate::rt::{MAX_TIMERS, MAX_WATCHES, MIN_TIMER_MS};","docs":""},{"module":"ckx_sdk::limits","name":"manifest","kind":"module","signature":"pub mod manifest","docs":"What a manifest may ask for a node type, and what it gets when it asks for nothing."},{"module":"ckx_sdk::limits","name":"mods","kind":"module","signature":"pub mod mods","docs":"What the platform gives every mod, in place of a manifest's limits."},{"module":"ckx_sdk::limits::manifest","name":"DEADLINE_DEFAULT_MS","kind":"const","signature":"pub const DEADLINE_DEFAULT_MS: u32 = 2_000;","docs":""},{"module":"ckx_sdk::limits::manifest","name":"DEADLINE_MAX_MS","kind":"const","signature":"pub const DEADLINE_MAX_MS: u32 = 10_000;","docs":""},{"module":"ckx_sdk::limits::manifest","name":"FUEL_DEFAULT","kind":"const","signature":"pub const FUEL_DEFAULT: u64 = 50_000_000;","docs":""},{"module":"ckx_sdk::limits::manifest","name":"FUEL_MAX","kind":"const","signature":"pub const FUEL_MAX: u64 = 1_000_000_000;","docs":""},{"module":"ckx_sdk::limits::manifest","name":"MEMORY_DEFAULT_MB","kind":"const","signature":"pub const MEMORY_DEFAULT_MB: u32 = 64;","docs":""},{"module":"ckx_sdk::limits::manifest","name":"MEMORY_MAX_MB","kind":"const","signature":"pub const MEMORY_MAX_MB: u32 = 512;","docs":""},{"module":"ckx_sdk::limits::mods","name":"ARTIFACT_MAX_BYTES","kind":"const","signature":"pub const ARTIFACT_MAX_BYTES: usize = 4 << 20;","docs":""},{"module":"ckx_sdk::limits::mods","name":"DEADLINE_MS","kind":"const","signature":"pub const DEADLINE_MS: u32 = 2_000;","docs":""},{"module":"ckx_sdk::limits::mods","name":"FUEL_PER_CALL","kind":"const","signature":"pub const FUEL_PER_CALL: u64 = 20_000_000;","docs":""},{"module":"ckx_sdk::limits::mods","name":"MEMORY_MB","kind":"const","signature":"pub const MEMORY_MB: u32 = 32;","docs":""},{"module":"ckx_sdk::limits::mods","name":"PER_GRID_MAX","kind":"const","signature":"pub const PER_GRID_MAX: usize = 8;","docs":"Mods one grid may run, and one owner may hold."},{"module":"ckx_sdk::limits::mods","name":"PER_OWNER_MAX","kind":"const","signature":"pub const PER_OWNER_MAX: usize = 64;","docs":""},{"module":"ckx_sdk::limits::mods","name":"RATE_PER_SEC","kind":"const","signature":"pub const RATE_PER_SEC: u32 = 20;","docs":"Handler calls per second, per mod instance."},{"module":"ckx_sdk::limits::mods","name":"SCOPES","kind":"const","signature":"pub const SCOPES: [&str; 3] = [\"grids.read\", \"world.read\", \"world.write\"];","docs":"The node API scopes every mod holds, each confined to its grid."},{"module":"ckx_sdk::limits::mods","name":"TYPE_PREFIX","kind":"const","signature":"pub const TYPE_PREFIX: &str = \"mod:\";","docs":"A mod is the hub `(\"mod:<name>\", \"<grid id>\")`."},{"module":"ckx_sdk::limits::mods","name":"WORLD_BATCH_MAX","kind":"const","signature":"pub const WORLD_BATCH_MAX: usize = 512;","docs":"World events in one `$world` call, at most."},{"module":"ckx_sdk::model","name":"Changes","kind":"struct","signature":"pub struct Changes { pub changed: Vec<u64>, pub removed: Vec<u64>, }","docs":"What changed since the last [`Model::take_changes`]."},{"module":"ckx_sdk::model","name":"Changes::changed","kind":"field","signature":"pub changed: Vec<u64>","docs":""},{"module":"ckx_sdk::model","name":"Changes::removed","kind":"field","signature":"pub removed: Vec<u64>","docs":""},{"module":"ckx_sdk::model","name":"Container","kind":"struct","signature":"pub struct Container { pub type_name: String, /// The player who owns it, if one does: they read its `Owner` properties. pub owner: Option<u64>, /// The key it was [`Model::ensure`]d under, if it was. pub key: Option<String>, /// Properties set so far; the rest read as their defaults. props: BTreeMap<String, Value>, }","docs":""},{"module":"ckx_sdk::model","name":"Container::key","kind":"field","signature":"pub key: Option<String>","docs":"The key it was [`Model::ensure`]d under, if it was."},{"module":"ckx_sdk::model","name":"Container::owner","kind":"field","signature":"pub owner: Option<u64>","docs":"The player who owns it, if one does: they read its `Owner` properties."},{"module":"ckx_sdk::model","name":"Container::type_name","kind":"field","signature":"pub type_name: String","docs":""},{"module":"ckx_sdk::model","name":"ContainerDef","kind":"struct","signature":"pub struct ContainerDef { props: BTreeMap<String, Prop>, }","docs":"Declares one container type's properties; see [`Schema::container`]."},{"module":"ckx_sdk::model","name":"ContainerDef::prop","kind":"method","signature":"pub fn prop(mut self, key: &str, kind: PropKind, default: impl Into<Value>, visibility: Visibility) -> Self","docs":"A property with its kind, its default, and who may read it. A default of the wrong kind panics when the schema is built, which is where a typo belongs."},{"module":"ckx_sdk::model","name":"Edge","kind":"struct","signature":"pub struct Edge { pub from: u64, pub relation: String, pub to: u64, }","docs":""},{"module":"ckx_sdk::model","name":"Edge::from","kind":"field","signature":"pub from: u64","docs":""},{"module":"ckx_sdk::model","name":"Edge::relation","kind":"field","signature":"pub relation: String","docs":""},{"module":"ckx_sdk::model","name":"Edge::to","kind":"field","signature":"pub to: u64","docs":""},{"module":"ckx_sdk::model","name":"MAX_DEPTH","kind":"const","signature":"pub const MAX_DEPTH: usize = 5;","docs":"The deepest [`Model::traverse`] walks, as the legacy graph traversal."},{"module":"ckx_sdk::model","name":"Model","kind":"struct","signature":"pub struct Model { next_id: u64, containers: BTreeMap<u64, Container>, /// `\"<type>\\0<key>\"` to the container ensured under it. keys: BTreeMap<String, u64>, edges: BTreeSet<Edge>, #[serde(skip)] changed: BTreeSet<u64>, #[serde(skip)] removed: BTreeSet<u64>, }","docs":""},{"module":"ckx_sdk::model","name":"Model::add","kind":"method","signature":"pub fn add(&mut self, schema: &Schema, id: u64, key: &str, delta: i64) -> Result<i64>","docs":"Adds `delta` to an integer property and returns the new value."},{"module":"ckx_sdk::model","name":"Model::container","kind":"method","signature":"pub fn container(&self, id: u64) -> Option<&Container>","docs":""},{"module":"ckx_sdk::model","name":"Model::create","kind":"method","signature":"pub fn create(&mut self, schema: &Schema, type_name: &str, owner: Option<u64>) -> Result<u64>","docs":"A new container of `type_name`, with every property at its default."},{"module":"ckx_sdk::model","name":"Model::delete","kind":"method","signature":"pub fn delete(&mut self, id: u64) -> bool","docs":"Removes a container, its key and every edge touching it."},{"module":"ckx_sdk::model","name":"Model::ensure","kind":"method","signature":"pub fn ensure(&mut self, schema: &Schema, type_name: &str, key: &str, owner: Option<u64>) -> Result<u64>","docs":"The container of `type_name` under `key`, created the first time: a player's character, a match's scoreboard."},{"module":"ckx_sdk::model","name":"Model::find","kind":"method","signature":"pub fn find(&self, type_name: &str, key: &str) -> Option<u64>","docs":""},{"module":"ckx_sdk::model","name":"Model::get","kind":"method","signature":"pub fn get(&self, schema: &Schema, id: u64, key: &str) -> Result<Value>","docs":"A property's value, or its default when it was never set."},{"module":"ckx_sdk::model","name":"Model::get_bool","kind":"method","signature":"pub fn get_bool(&self, schema: &Schema, id: u64, key: &str) -> Result<bool>","docs":""},{"module":"ckx_sdk::model","name":"Model::get_f64","kind":"method","signature":"pub fn get_f64(&self, schema: &Schema, id: u64, key: &str) -> Result<f64>","docs":""},{"module":"ckx_sdk::model","name":"Model::get_i64","kind":"method","signature":"pub fn get_i64(&self, schema: &Schema, id: u64, key: &str) -> Result<i64>","docs":""},{"module":"ckx_sdk::model","name":"Model::get_str","kind":"method","signature":"pub fn get_str(&self, schema: &Schema, id: u64, key: &str) -> Result<String>","docs":""},{"module":"ckx_sdk::model","name":"Model::ids","kind":"method","signature":"pub fn ids(&self) -> impl Iterator<Item = u64> + '_","docs":"Every container's id, oldest first."},{"module":"ckx_sdk::model","name":"Model::link","kind":"method","signature":"pub fn link(&mut self, from: u64, relation: &str, to: u64) -> Result<()>","docs":"`from --relation--> to`, e.g. an inventory holding an item."},{"module":"ckx_sdk::model","name":"Model::linked","kind":"method","signature":"pub fn linked(&self, from: u64, relation: &str) -> Vec<u64>","docs":"The containers `from` links to by `relation`."},{"module":"ckx_sdk::model","name":"Model::new","kind":"method","signature":"pub fn new() -> Self","docs":""},{"module":"ckx_sdk::model","name":"Model::of_type","kind":"method","signature":"pub fn of_type<'a>(&'a self, type_name: &'a str) -> impl Iterator<Item = u64> + 'a","docs":"Every container of `type_name`, oldest first."},{"module":"ckx_sdk::model","name":"Model::public_changes","kind":"method","signature":"pub fn public_changes(&mut self, schema: &Schema) -> Vec<Published>","docs":"The changes since the last call as what anyone may see: each changed container's public view, and each removal."},{"module":"ckx_sdk::model","name":"Model::publish_changes","kind":"method","signature":"pub fn publish_changes(&mut self, ctx: &Ctx, schema: &Schema, topic: &str)","docs":"Publishes [`Model::public_changes`] on this hub's `topic`, one message per container, for subscribed clients. Owner and hidden properties are never published."},{"module":"ckx_sdk::model","name":"Model::set","kind":"method","signature":"pub fn set(&mut self, schema: &Schema, id: u64, key: &str, value: impl Into<Value>) -> Result<()>","docs":"Sets a property, refusing a value of the wrong kind."},{"module":"ckx_sdk::model","name":"Model::take_changes","kind":"method","signature":"pub fn take_changes(&mut self) -> Changes","docs":"The containers changed and removed since the last call."},{"module":"ckx_sdk::model","name":"Model::traverse","kind":"method","signature":"pub fn traverse(&self, root: u64, relation: &str, depth: usize) -> Vec<u64>","docs":"Every container reachable from `root` by `relation`, breadth first, at most [`MAX_DEPTH`] steps away; `root` itself is not included."},{"module":"ckx_sdk::model","name":"Model::unlink","kind":"method","signature":"pub fn unlink(&mut self, from: u64, relation: &str, to: u64) -> bool","docs":""},{"module":"ckx_sdk::model","name":"Model::view","kind":"method","signature":"pub fn view(&self, schema: &Schema, id: u64, viewer: Viewer) -> Result<BTreeMap<String, Value>>","docs":"The properties `viewer` may read, with defaults filled in: every one for the server, public ones for a player, and owner ones too on containers the player owns."},{"module":"ckx_sdk::model","name":"Prop","kind":"struct","signature":"pub struct Prop { pub kind: PropKind, pub default: Value, pub visibility: Visibility, }","docs":""},{"module":"ckx_sdk::model","name":"Prop::default","kind":"field","signature":"pub default: Value","docs":""},{"module":"ckx_sdk::model","name":"Prop::kind","kind":"field","signature":"pub kind: PropKind","docs":""},{"module":"ckx_sdk::model","name":"Prop::visibility","kind":"field","signature":"pub visibility: Visibility","docs":""},{"module":"ckx_sdk::model","name":"PropKind","kind":"enum","signature":"pub enum PropKind { Bool, Int, Float, Str, Json, }","docs":"What a property holds. `Json` holds any JSON value."},{"module":"ckx_sdk::model","name":"PropKind::Bool","kind":"variant","signature":"Bool","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Float","kind":"variant","signature":"Float","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Int","kind":"variant","signature":"Int","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Json","kind":"variant","signature":"Json","docs":""},{"module":"ckx_sdk::model","name":"PropKind::Str","kind":"variant","signature":"Str","docs":""},{"module":"ckx_sdk::model","name":"Published","kind":"struct","signature":"pub struct Published { pub id: u64, #[serde(default, skip_serializing_if = \"Option::is_none\")] pub type_name: Option<String>, #[serde(default, skip_serializing_if = \"Option::is_none\")] pub props: Option<BTreeMap<String, Value>>, #[serde(default, skip_serializing_if = \"std::ops::Not::not\")] pub removed: bool, }","docs":"One published change: a container's public view, or its removal."},{"module":"ckx_sdk::model","name":"Published::id","kind":"field","signature":"pub id: u64","docs":""},{"module":"ckx_sdk::model","name":"Published::props","kind":"field","signature":"pub props: Option<BTreeMap<String, Value>>","docs":""},{"module":"ckx_sdk::model","name":"Published::removed","kind":"field","signature":"pub removed: bool","docs":""},{"module":"ckx_sdk::model","name":"Published::type_name","kind":"field","signature":"pub type_name: Option<String>","docs":""},{"module":"ckx_sdk::model","name":"Schema","kind":"struct","signature":"pub struct Schema { types: BTreeMap<String, BTreeMap<String, Prop>>, }","docs":"The declared container types and their properties."},{"module":"ckx_sdk::model","name":"Schema::container","kind":"method","signature":"pub fn container(mut self, name: &str, define: impl FnOnce(ContainerDef) -> ContainerDef) -> Self","docs":""},{"module":"ckx_sdk::model","name":"Schema::new","kind":"method","signature":"pub fn new() -> Self","docs":""},{"module":"ckx_sdk::model","name":"Viewer","kind":"enum","signature":"pub enum Viewer { /// The hub, another instance or a developer: every property. Server, /// A player: public properties, and owner ones on containers the player owns. Player(u64), /// Anyone: public properties only, as [`Model::publish_changes`] sends them. Public, }","docs":"Who a [`Model::view`] is for."},{"module":"ckx_sdk::model","name":"Viewer::Player","kind":"variant","signature":"Player(u64)","docs":"A player: public properties, and owner ones on containers the player owns."},{"module":"ckx_sdk::model","name":"Viewer::Public","kind":"variant","signature":"Public","docs":"Anyone: public properties only, as [`Model::publish_changes`] sends them."},{"module":"ckx_sdk::model","name":"Viewer::Server","kind":"variant","signature":"Server","docs":"The hub, another instance or a developer: every property."},{"module":"ckx_sdk::model","name":"Visibility","kind":"enum","signature":"pub enum Visibility { Public, Owner, Hidden, }","docs":"Who may read a property: anyone who may read the container, only its owner, or nobody but the hub itself (secret stats, seeds)."},{"module":"ckx_sdk::model","name":"Visibility::Hidden","kind":"variant","signature":"Hidden","docs":""},{"module":"ckx_sdk::model","name":"Visibility::Owner","kind":"variant","signature":"Owner","docs":""},{"module":"ckx_sdk::model","name":"Visibility::Public","kind":"variant","signature":"Public","docs":""},{"module":"ckx_sdk::node","name":"Access","kind":"struct","signature":"pub struct Access<'a>(pub(crate) &'a Ctx);","docs":"Players' access to this app: [`Ctx::access`]."},{"module":"ckx_sdk::node","name":"Access::get","kind":"method","signature":"pub fn get(&self, player: u64) -> Result<Option<PlayerAccess>, CallError>","docs":"The player's access to the app, or `None` when they never had any. Scope `access.read`."},{"module":"ckx_sdk::node","name":"Access::grant","kind":"method","signature":"pub fn grant(&self, player: u64, tier: Option<u64>) -> Result<PlayerAccess, CallError>","docs":"Gives the player access to the app, in access tier `tier` when one is named. Scope `access.write`."},{"module":"ckx_sdk::node","name":"Access::revoke","kind":"method","signature":"pub fn revoke(&self, player: u64) -> Result<(), CallError>","docs":"Takes the player's access away. Scope `access.write`."},{"module":"ckx_sdk::node","name":"Access::suspend","kind":"method","signature":"pub fn suspend(&self, player: u64, seconds: u32) -> Result<String, CallError>","docs":"Suspends the player's access for `seconds`. Returns until when (RFC 3339). Scope `access.write`."},{"module":"ckx_sdk::node","name":"Access::unsuspend","kind":"method","signature":"pub fn unsuspend(&self, player: u64) -> Result<(), CallError>","docs":"Ends the player's suspension. Scope `access.write`."},{"module":"ckx_sdk::node","name":"Actor","kind":"struct","signature":"pub struct Actor { /// The 32-character actor id. pub uuid: String, pub player: Option<u64>, pub chunk: ChunkPos, /// The actor's persisted public state, where the game keeps one. pub state: Option<Vec<u8>>, }","docs":"A player's actor in the world, from live presence."},{"module":"ckx_sdk::node","name":"Actor::chunk","kind":"field","signature":"pub chunk: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Actor::player","kind":"field","signature":"pub player: Option<u64>","docs":""},{"module":"ckx_sdk::node","name":"Actor::state","kind":"field","signature":"pub state: Option<Vec<u8>>","docs":"The actor's persisted public state, where the game keeps one."},{"module":"ckx_sdk::node","name":"Actor::uuid","kind":"field","signature":"pub uuid: String","docs":"The 32-character actor id."},{"module":"ckx_sdk::node","name":"Chunk","kind":"struct","signature":"pub struct Chunk { pub id: u64, pub at: ChunkPos, pub voxels: Option<Vec<u8>>, pub chunk_state: Option<Vec<u8>>, }","docs":"A chunk as stored: the dense voxel grid and the game's own metadata blob."},{"module":"ckx_sdk::node","name":"Chunk::at","kind":"field","signature":"pub at: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Chunk::chunk_state","kind":"field","signature":"pub chunk_state: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"Chunk::id","kind":"field","signature":"pub id: u64","docs":""},{"module":"ckx_sdk::node","name":"Chunk::voxels","kind":"field","signature":"pub voxels: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos","kind":"struct","signature":"pub struct ChunkPos { pub x: i64, pub y: i64, pub z: i64, }","docs":"A chunk's coordinates."},{"module":"ckx_sdk::node","name":"ChunkPos::from","kind":"method","signature":"fn from(p: WirePos) -> Self","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::new","kind":"method","signature":"pub const fn new(x: i64, y: i64, z: i64) -> Self","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::x","kind":"field","signature":"pub x: i64","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::y","kind":"field","signature":"pub y: i64","docs":""},{"module":"ckx_sdk::node","name":"ChunkPos::z","kind":"field","signature":"pub z: i64","docs":""},{"module":"ckx_sdk::node","name":"Grid","kind":"struct","signature":"pub struct Grid { pub id: u64, pub low: ChunkPos, pub high: ChunkPos, /// Who holds it, where the platform records an owner. pub owner: Option<GridOwner>, /// Permission keys every player holds on it, granted or not. pub open_permissions: Vec<String>, }","docs":"A grid: a box of chunks with its own permissions."},{"module":"ckx_sdk::node","name":"Grid::contains","kind":"method","signature":"pub fn contains(&self, at: ChunkPos) -> bool","docs":""},{"module":"ckx_sdk::node","name":"Grid::from","kind":"method","signature":"fn from(g: WireGrid) -> Self","docs":""},{"module":"ckx_sdk::node","name":"Grid::high","kind":"field","signature":"pub high: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Grid::id","kind":"field","signature":"pub id: u64","docs":""},{"module":"ckx_sdk::node","name":"Grid::low","kind":"field","signature":"pub low: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"Grid::open_permissions","kind":"field","signature":"pub open_permissions: Vec<String>","docs":"Permission keys every player holds on it, granted or not."},{"module":"ckx_sdk::node","name":"Grid::owner","kind":"field","signature":"pub owner: Option<GridOwner>","docs":"Who holds it, where the platform records an owner."},{"module":"ckx_sdk::node","name":"GridOwner","kind":"struct","signature":"pub struct GridOwner { pub kind: String, #[serde(rename = \"ref\")] pub ref_: String, }","docs":"A grid's owner: what kind of party it is, and which."},{"module":"ckx_sdk::node","name":"GridOwner::kind","kind":"field","signature":"pub kind: String","docs":""},{"module":"ckx_sdk::node","name":"GridOwner::ref_","kind":"field","signature":"pub ref_: String","docs":""},{"module":"ckx_sdk::node","name":"GridPick","kind":"enum","signature":"pub enum GridPick { /// The lowest grid id: what the realtime tier enforces. #[default] First, Smallest, Largest, }","docs":"Which grid [`Grids::at`] returns where grids overlap."},{"module":"ckx_sdk::node","name":"GridPick::First","kind":"variant","signature":"First","docs":"The lowest grid id: what the realtime tier enforces."},{"module":"ckx_sdk::node","name":"GridPick::Largest","kind":"variant","signature":"Largest","docs":""},{"module":"ckx_sdk::node","name":"GridPick::Smallest","kind":"variant","signature":"Smallest","docs":""},{"module":"ckx_sdk::node","name":"GridSettings","kind":"struct","signature":"pub struct GridSettings { /// Players may write voxels outside every grid. pub wilderness_writes_open: bool, }","docs":"The app's grid rules, from [`Grids::settings`]."},{"module":"ckx_sdk::node","name":"GridSettings::wilderness_writes_open","kind":"field","signature":"pub wilderness_writes_open: bool","docs":"Players may write voxels outside every grid."},{"module":"ckx_sdk::node","name":"Grids","kind":"struct","signature":"pub struct Grids<'a>(pub(crate) &'a Ctx);","docs":"Grids and their permissions: [`Ctx::grids`]."},{"module":"ckx_sdk::node","name":"Grids::assign_group","kind":"method","signature":"pub fn assign_group(&self, grid: u64, group: u64, permissions: &[&str]) -> Result<(), CallError>","docs":"Gives the members of one of the app's groups `permissions` on `grid`. Scope `grids.write`."},{"module":"ckx_sdk::node","name":"Grids::at","kind":"method","signature":"pub fn at(&self, at: ChunkPos, pick: GridPick) -> Result<Option<Grid>, CallError>","docs":"The grid covering chunk `at`, if any. Scope `grids.read`."},{"module":"ckx_sdk::node","name":"Grids::check_permission","kind":"method","signature":"pub fn check_permission(&self, grid: u64, player: u64, permission: &str) -> Result<bool, CallError>","docs":"Whether `player` holds `permission` on `grid` (granted directly or through a group, and not expired). Scope `grids.read`."},{"module":"ckx_sdk::node","name":"Grids::create","kind":"method","signature":"pub fn create(&self, low: ChunkPos, high: ChunkPos) -> Result<Grid, CallError>","docs":"A new grid of the app from chunk `low` to chunk `high`, both included. Scope `grids.write`."},{"module":"ckx_sdk::node","name":"Grids::delete","kind":"method","signature":"pub fn delete(&self, grid: u64) -> Result<(), CallError>","docs":"Removes one of the app's grids. Scope `grids.write`."},{"module":"ckx_sdk::node","name":"Grids::get","kind":"method","signature":"pub fn get(&self, grid: u64) -> Result<Option<Grid>, CallError>","docs":"One of this app's grids. Scope `grids.read`."},{"module":"ckx_sdk::node","name":"Grids::set_open_permissions","kind":"method","signature":"pub fn set_open_permissions(&self, grid: u64, permissions: &[&str]) -> Result<(), CallError>","docs":"Replaces the permission keys every player holds on `grid` ([`Grid::open_permissions`]). Scope `grids.write`."},{"module":"ckx_sdk::node","name":"Grids::settings","kind":"method","signature":"pub fn settings(&self) -> Result<GridSettings, CallError>","docs":"The app's grid rules. Scope `grids.read`."},{"module":"ckx_sdk::node","name":"Grids::unassign_group","kind":"method","signature":"pub fn unassign_group(&self, grid: u64, group: u64) -> Result<(), CallError>","docs":"Takes back what [`Grids::assign_group`] gave the group on `grid`. Scope `grids.write`."},{"module":"ckx_sdk::node","name":"MAX_CHUNK_STATE","kind":"const","signature":"pub const MAX_CHUNK_STATE: usize = 65_536;","docs":"A chunk's state bytes ([`World::set_chunk_state`])."},{"module":"ckx_sdk::node","name":"MAX_VOXEL_STATE","kind":"const","signature":"pub const MAX_VOXEL_STATE: usize = 1024;","docs":"A voxel's state bytes."},{"module":"ckx_sdk::node","name":"MAX_VOXEL_WRITES","kind":"const","signature":"pub const MAX_VOXEL_WRITES: usize = 16;","docs":"Voxel writes in one [`World::set_voxels`] call."},{"module":"ckx_sdk::node","name":"Permissions","kind":"struct","signature":"pub struct Permissions<'a>(pub(crate) &'a Ctx);","docs":"Grid permission grants: [`Ctx::permissions`]."},{"module":"ckx_sdk::node","name":"Permissions::grant","kind":"method","signature":"pub fn grant(&self, grid: u64, player: u64, keys: &[&str], ttl_secs: Option<u32>) -> Result<Option<String>, CallError>","docs":"Grants runtime permission keys on one of this app's grids to a player with access to the app, for `ttl_secs` or until revoked. Returns when the grant expires (RFC 3339), if it does. Scope `permissions.write`."},{"module":"ckx_sdk::node","name":"Permissions::revoke","kind":"method","signature":"pub fn revoke(&self, grid: u64, player: u64, keys: Option<&[&str]>) -> Result<(), CallError>","docs":"Revokes the named keys, or every key when `keys` is `None`. Scope `permissions.write`."},{"module":"ckx_sdk::node","name":"Player","kind":"struct","signature":"pub struct Player { #[serde(deserialize_with = \"de_u64\")] pub player: u64, pub gamertag: String, /// What tells players with the same gamertag apart; most players have none. #[serde(default)] pub disambiguation: Option<String>, }","docs":"A player's public identity."},{"module":"ckx_sdk::node","name":"Player::disambiguation","kind":"field","signature":"pub disambiguation: Option<String>","docs":"What tells players with the same gamertag apart; most players have none."},{"module":"ckx_sdk::node","name":"Player::gamertag","kind":"field","signature":"pub gamertag: String","docs":""},{"module":"ckx_sdk::node","name":"Player::player","kind":"field","signature":"pub player: u64","docs":""},{"module":"ckx_sdk::node","name":"PlayerAccess","kind":"struct","signature":"pub struct PlayerAccess { /// `active`, `revoked`, or another state the platform names. pub status: String, /// The access tier, if any. #[serde(default, rename = \"tierId\", deserialize_with = \"de_opt_u64\")] pub tier: Option<u64>, /// When it ends (RFC 3339), if it does. #[serde(default)] pub expires_at: Option<String>, /// Until when the player is suspended (RFC 3339), while they are. #[serde(default)] pub suspended_until: Option<String>, }","docs":"A player's access to the app, from [`Access::get`] and [`Access::grant`]."},{"module":"ckx_sdk::node","name":"PlayerAccess::expires_at","kind":"field","signature":"pub expires_at: Option<String>","docs":"When it ends (RFC 3339), if it does."},{"module":"ckx_sdk::node","name":"PlayerAccess::status","kind":"field","signature":"pub status: String","docs":"`active`, `revoked`, or another state the platform names."},{"module":"ckx_sdk::node","name":"PlayerAccess::suspended_until","kind":"field","signature":"pub suspended_until: Option<String>","docs":"Until when the player is suspended (RFC 3339), while they are."},{"module":"ckx_sdk::node","name":"PlayerAccess::tier","kind":"field","signature":"pub tier: Option<u64>","docs":"The access tier, if any."},{"module":"ckx_sdk::node","name":"Players","kind":"struct","signature":"pub struct Players<'a>(pub(crate) &'a Ctx);","docs":"Player lookups and app state: [`Ctx::players`]."},{"module":"ckx_sdk::node","name":"Players::avatar_state","kind":"method","signature":"pub fn avatar_state(&self, avatar: u64) -> Result<Option<Vec<u8>>, CallError>","docs":"An avatar's state blob for this app. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::check_permission","kind":"method","signature":"pub fn check_permission(&self, player: u64, group: u64, permission: Option<&str>) -> Result<bool, CallError>","docs":"Whether the player is an active member of one of this app's groups (teams, channels), or holds `permission` in it when one is named. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::features","kind":"method","signature":"pub fn features(&self, player: u64) -> Result<Vec<String>, CallError>","docs":"The feature keys the player's access tier grants in this app. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::get","kind":"method","signature":"pub fn get(&self, player: u64) -> Result<Player, CallError>","docs":"A player's public identity, for players currently in this app. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Players::set_state","kind":"method","signature":"pub fn set_state(&self, player: u64, state: Option<&[u8]>) -> Result<(), CallError>","docs":"Replaces the player's state blob for this app (at most 256 KiB; `None` clears it). The player must have access to the app. Scope `players.write`."},{"module":"ckx_sdk::node","name":"Players::state","kind":"method","signature":"pub fn state(&self, player: u64) -> Result<Option<Vec<u8>>, CallError>","docs":"The player's state blob for this app, which game clients read too. Scope `players.read`."},{"module":"ckx_sdk::node","name":"Voxel","kind":"struct","signature":"pub struct Voxel { pub x: i16, pub y: i16, pub z: i16, /// What a type means is up to the app. pub voxel_type: i16, pub state: Option<Vec<u8>>, /// Who wrote it: a user id in decimal, `\"0\"` when the app's own code did. `None` from a /// platform that does not say. pub created_by: Option<String>, /// When it was written (RFC 3339). pub updated_at: Option<String>, }","docs":"A voxel written into a chunk (the edits on top of its dense grid), with who wrote it and when."},{"module":"ckx_sdk::node","name":"Voxel::created_by","kind":"field","signature":"pub created_by: Option<String>","docs":"Who wrote it: a user id in decimal, `\"0\"` when the app's own code did. `None` from a platform that does not say."},{"module":"ckx_sdk::node","name":"Voxel::from","kind":"method","signature":"fn from(v: WireVoxel) -> Self","docs":""},{"module":"ckx_sdk::node","name":"Voxel::state","kind":"field","signature":"pub state: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"Voxel::updated_at","kind":"field","signature":"pub updated_at: Option<String>","docs":"When it was written (RFC 3339)."},{"module":"ckx_sdk::node","name":"Voxel::voxel_type","kind":"field","signature":"pub voxel_type: i16","docs":"What a type means is up to the app."},{"module":"ckx_sdk::node","name":"Voxel::x","kind":"field","signature":"pub x: i16","docs":""},{"module":"ckx_sdk::node","name":"Voxel::y","kind":"field","signature":"pub y: i16","docs":""},{"module":"ckx_sdk::node","name":"Voxel::z","kind":"field","signature":"pub z: i16","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite","kind":"struct","signature":"pub struct VoxelWrite { pub chunk: ChunkPos, /// `(x, y, z)` within the chunk. Positions are the app's to define; an app on the 16×16×16 /// dense grid keeps to 0 to 15 on each axis. pub voxel: (i16, i16, i16), /// What a type means is up to the app. pub voxel_type: i16, pub state: Option<Vec<u8>>, }","docs":"One voxel to write: `voxel` is its position within `chunk`."},{"module":"ckx_sdk::node","name":"VoxelWrite::chunk","kind":"field","signature":"pub chunk: ChunkPos","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite::state","kind":"field","signature":"pub state: Option<Vec<u8>>","docs":""},{"module":"ckx_sdk::node","name":"VoxelWrite::voxel","kind":"field","signature":"pub voxel: (i16, i16, i16)","docs":"`(x, y, z)` within the chunk. Positions are the app's to define; an app on the 16×16×16 dense grid keeps to 0 to 15 on each axis."},{"module":"ckx_sdk::node","name":"VoxelWrite::voxel_type","kind":"field","signature":"pub voxel_type: i16","docs":"What a type means is up to the app."},{"module":"ckx_sdk::node","name":"World","kind":"struct","signature":"pub struct World<'a>(pub(crate) &'a Ctx);","docs":"World reads and writes: [`Ctx::world`]."},{"module":"ckx_sdk::node","name":"World::actors","kind":"method","signature":"pub fn actors(&self, at: ChunkPos) -> Result<Vec<Actor>, CallError>","docs":"The actors in one chunk. Scope `world.read`."},{"module":"ckx_sdk::node","name":"World::actors_near","kind":"method","signature":"pub fn actors_near(&self, center: ChunkPos, radius_xz: u8, radius_y: u8) -> Result<Vec<Actor>, CallError>","docs":"The actors within `radius_xz` chunks across and `radius_y` up and down (at most 3 and 1). Scope `world.read`."},{"module":"ckx_sdk::node","name":"World::chunk","kind":"method","signature":"pub fn chunk(&self, at: ChunkPos) -> Result<Option<Chunk>, CallError>","docs":"The chunk at `at`, or `None` when the app never stored it. Scope `world.read`."},{"module":"ckx_sdk::node","name":"World::set_chunk_state","kind":"method","signature":"pub fn set_chunk_state(&self, chunk: ChunkPos, state: Option<&[u8]>) -> Result<(), CallError>","docs":"Replaces the chunk's own state blob, the one [`Chunk::chunk_state`] reads (at most [`MAX_CHUNK_STATE`] bytes; `None` clears it). Scope `world.write`."},{"module":"ckx_sdk::node","name":"World::set_voxels","kind":"method","signature":"pub fn set_voxels(&self, writes: &[VoxelWrite]) -> Result<Vec<u64>, CallError>","docs":"Writes up to [`MAX_VOXEL_WRITES`] voxels in one transaction, as the app, and shows them to nearby players. Returns the voxel update ids. Scope `world.write`."},{"module":"ckx_sdk::node","name":"World::voxels","kind":"method","signature":"pub fn voxels(&self, at: ChunkPos) -> Result<Vec<Voxel>, CallError>","docs":"The voxels written into a chunk, at most 2,048. Scope `world.read`."},{"module":"ckx_sdk::prelude","name":"Cron","kind":"reexport","signature":"pub use crate::cron::Cron;","docs":""},{"module":"ckx_sdk::prelude","name":"crate::emit::{Spatial, actor_id}","kind":"reexport","signature":"pub use crate::emit::{Spatial, actor_id};","docs":""},{"module":"ckx_sdk::prelude","name":"crate::model::{Model, PropKind, Schema, Viewer, Visibility}","kind":"reexport","signature":"pub use crate::model::{Model, PropKind, Schema, Viewer, Visibility};","docs":""},{"module":"ckx_sdk::prelude","name":"crate::node::{ChunkPos, GridPick, VoxelWrite}","kind":"reexport","signature":"pub use crate::node::{ChunkPos, GridPick, VoxelWrite};","docs":""},{"module":"ckx_sdk::prelude","name":"crate::{\n Call, CallError, Caller, Ctx, Error, Hub, Kind, Level, Presence, PresencePlayer, Result, Session, Spoke, Status, TopicMsg,\n WorldEvent, decode, encode,\n }","kind":"reexport","signature":"pub use crate::{ Call, CallError, Caller, Ctx, Error, Hub, Kind, Level, Presence, PresencePlayer, Result, Session, Spoke, Status, TopicMsg, WorldEvent, decode, encode, };","docs":""},{"module":"ckx_sdk::prelude","name":"serde::{Deserialize, Serialize}","kind":"reexport","signature":"pub use serde::{Deserialize, Serialize};","docs":""},{"module":"core","name":"assert","kind":"macro","signature":"assert!(condition[, message])","docs":"Panics when a condition is false."},{"module":"core","name":"assert_eq","kind":"macro","signature":"assert_eq!(left, right[, message])","docs":"Panics when two expressions are not equal."},{"module":"core","name":"matches","kind":"macro","signature":"matches!(expression, pattern [if guard])","docs":"Checks whether an expression matches a pattern."},{"module":"core","name":"panic","kind":"macro","signature":"panic!([message])","docs":"Terminates the current execution with an error."},{"module":"core::mem","name":"drop","kind":"function","signature":"pub fn drop<T>(_x: T)","docs":"Consumes and drops a value."},{"module":"core::mem","name":"forget","kind":"function","signature":"pub const fn forget<T>(t: T)","docs":"Consumes a value without running its destructor."},{"module":"core::prelude::v1","name":"Clone","kind":"trait","signature":"pub trait Clone { fn clone(&self) -> Self; }","docs":"Explicitly duplicates a value."},{"module":"core::prelude::v1","name":"Copy","kind":"trait","signature":"pub trait Copy: Clone","docs":"Marks values duplicated by assignment."},{"module":"core::prelude::v1","name":"Default","kind":"trait","signature":"pub trait Default { fn default() -> Self; }","docs":"Constructs a useful default value."},{"module":"core::prelude::v1","name":"Err","kind":"variant","signature":"Err(E) -> Result<T, E>","docs":"Constructs an error Result value."},{"module":"core::prelude::v1","name":"IntoIterator","kind":"trait","signature":"pub trait IntoIterator { type Item; type IntoIter: Iterator<Item = Self::Item>; }","docs":"Converts a value into an iterator."},{"module":"core::prelude::v1","name":"Iterator","kind":"trait","signature":"pub trait Iterator { type Item; fn next(&mut self) -> Option<Self::Item>; }","docs":"Produces a sequence of values."},{"module":"core::prelude::v1","name":"None","kind":"variant","signature":"None -> Option<T>","docs":"Constructs an absent Option value."},{"module":"core::prelude::v1","name":"Ok","kind":"variant","signature":"Ok(T) -> Result<T, E>","docs":"Constructs a successful Result value."},{"module":"core::prelude::v1","name":"Option","kind":"enum","signature":"pub enum Option<T> { None, Some(T) }","docs":"An optional value."},{"module":"core::prelude::v1","name":"Result","kind":"enum","signature":"pub enum Result<T, E> { Ok(T), Err(E) }","docs":"A success value or an error."},{"module":"core::prelude::v1","name":"Some","kind":"variant","signature":"Some(T) -> Option<T>","docs":"Constructs a present Option value."},{"module":"core::slice","name":"from_raw_parts","kind":"function","signature":"pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T]","docs":"Forms a slice from a pointer and element count."},{"module":"crowdy_client_sdk","name":"ABI_VERSION","kind":"const","signature":"pub const ABI_VERSION: u32 = 0;","docs":""},{"module":"crowdy_client_sdk","name":"HostError","kind":"struct","signature":"pub struct HostError { pub kind: String, #[serde(default)] pub message: Option<String>, }","docs":"A host call the broker or the page refused, or that failed. The browser answers a refusal (outside the allowlist, outside the grid, over a rate cap, not offered by this game) with `kind` `denied` and a message saying why."},{"module":"crowdy_client_sdk","name":"HostError::fmt","kind":"method","signature":"fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result","docs":""},{"module":"crowdy_client_sdk","name":"HostError::kind","kind":"field","signature":"pub kind: String","docs":""},{"module":"crowdy_client_sdk","name":"HostError::message","kind":"field","signature":"pub message: Option<String>","docs":""},{"module":"crowdy_client_sdk","name":"api","kind":"module","signature":"pub mod api","docs":"The client host calls. The broker confines each to the mod's grid (chunk coordinates inside the grid's box, `gridId` the mod's own) and the page answers it as the visiting player, with that player's permissions; a game may leave some unanswered (`denied`). Ids are strings where they may exceed 2^53."},{"module":"crowdy_client_sdk","name":"ck_alloc","kind":"function","signature":"pub extern \"C\" fn ck_alloc(len: u32) -> *mut u8","docs":"Allocates a buffer the host writes into before it calls an export."},{"module":"crowdy_client_sdk","name":"ck_free","kind":"function","signature":"pub unsafe extern \"C\" fn ck_free(ptr: *mut u8, len: u32)","docs":"Releases a buffer handed across the boundary. # Safety `ptr`/`len` must come from `ck_alloc` or a packed return value."},{"module":"crowdy_client_sdk","name":"host","kind":"module","signature":"pub mod host","docs":"Host imports (module `ck`)."},{"module":"crowdy_client_sdk","name":"host_call","kind":"function","signature":"pub fn host_call(fn_name: &str, args: serde_json::Value) -> Result<serde_json::Value, HostError>","docs":"Calls a host function with JSON args and returns its `data`."},{"module":"crowdy_client_sdk","name":"input_slice","kind":"function","signature":"pub unsafe fn input_slice<'a>(ptr: *const u8, len: u32) -> &'a [u8]","docs":"A host-provided buffer. # Safety `ptr`/`len` must describe a live buffer in guest memory."},{"module":"crowdy_client_sdk","name":"log","kind":"function","signature":"pub fn log(level: u32, msg: &str)","docs":""},{"module":"crowdy_client_sdk","name":"now_ms","kind":"function","signature":"pub fn now_ms() -> u64","docs":""},{"module":"crowdy_client_sdk","name":"pack_return","kind":"function","signature":"pub fn pack_return(bytes: Vec<u8>) -> u64","docs":"Leaks `bytes` and packs its (ptr, len) into the u64 return convention."},{"module":"crowdy_client_sdk","name":"random_bytes","kind":"function","signature":"pub fn random_bytes(len: usize) -> Vec<u8>","docs":"Random bytes from the browser's `crypto.getRandomValues`."},{"module":"crowdy_client_sdk","name":"register_module","kind":"macro","signature":"macro_rules! register_module { (init: $init:path, tick: $tick:path, invoke: $invoke:path $(,)?) => { $crate::__register_module_core!($init, $tick, $invoke); }; (init: $init:path, tick: $tick:path, invoke: $invoke:path, event: $event:path $(,)?) => { $crate::__register_module_core!($init, $tick, $invoke); #[export_name = \"on_event\"] pub extern \"C\" fn __ck_export_on_event(ptr: *const u8, len: u32) { let input = unsafe { $crate::input_slice(ptr, len) }; $event(input); } }; }","docs":"Wires a CLIENT half's functions to the exports the browser calls: `init()`, `tick(dt_ms)`, `handle_invoke(ptr, len) -> packed u64`, and, in the four-argument form, `on_event(ptr, len)` for grid events from the page's bus. The three-argument form exports no `on_event`. ```ignore use crowdy_client_sdk as crowdy; fn init() {} fn tick(_dt_ms: u32) { let _ = crowdy::api::hud_set(serde_json::json!({ \"text\": \"hello\" })); } fn invoke(payload: &[u8]) -> Vec<u8> { payload.to_vec() } crowdy::register_module!(init: init, tick: tick, invoke: invoke); ```"},{"module":"crowdy_client_sdk","name":"state_get","kind":"function","signature":"pub fn state_get() -> Vec<u8>","docs":"The state blob (empty when unset)."},{"module":"crowdy_client_sdk","name":"state_set","kind":"function","signature":"pub fn state_set(bytes: &[u8]) -> bool","docs":"Replaces the state blob."},{"module":"crowdy_client_sdk::api","name":"actor_despawn","kind":"function","signature":"pub fn actor_despawn(actor_id: &str) -> Result<Value, HostError>","docs":"Removes a mod-owned actor of this session."},{"module":"crowdy_client_sdk::api","name":"actor_pose","kind":"function","signature":"pub fn actor_pose(actor_id: &str, pose: Value) -> Result<Value, HostError>","docs":"Moves a mod-owned actor of this session. A position outside the grid is refused."},{"module":"crowdy_client_sdk::api","name":"actor_spawn","kind":"function","signature":"pub fn actor_spawn(actor: Value) -> Result<Value, HostError>","docs":"Places a mod-owned actor inside the grid. A live player's id is refused."},{"module":"crowdy_client_sdk::api","name":"actors_list","kind":"function","signature":"pub fn actors_list(x: i64, y: i64, z: i64) -> Result<Value, HostError>","docs":"The actors in one chunk inside the grid, as the page sees them."},{"module":"crowdy_client_sdk::api","name":"actors_list_radius","kind":"function","signature":"pub fn actors_list_radius( x: i64, y: i64, z: i64, radius_xz: u8, radius_y: u8, ) -> Result<Value, HostError>","docs":"The actors in a box of chunks around (x, y, z): `radius_xz` at most 3 and `radius_y` at most 1, clipped to the grid."},{"module":"crowdy_client_sdk::api","name":"avatar_appearance","kind":"function","signature":"pub fn avatar_appearance(appearance: Value) -> Result<Value, HostError>","docs":"The visiting player's avatar tint."},{"module":"crowdy_client_sdk::api","name":"avatar_state_get","kind":"function","signature":"pub fn avatar_state_get(avatar_id: &str) -> Result<Value, HostError>","docs":"An avatar's app state, for an avatar whose actor is inside the grid."},{"module":"crowdy_client_sdk::api","name":"avatar_state_set","kind":"function","signature":"pub fn avatar_state_set(avatar_id: &str, state_base64: &str) -> Result<Value, HostError>","docs":"The visiting player's own avatar state blob."},{"module":"crowdy_client_sdk::api","name":"chunk_get","kind":"function","signature":"pub fn chunk_get(x: i64, y: i64, z: i64) -> Result<Value, HostError>","docs":"One chunk inside the grid: `{ voxelsBase64 }`."},{"module":"crowdy_client_sdk::api","name":"clock","kind":"function","signature":"pub fn clock() -> Result<Value, HostError>","docs":"The page's wall clock, milliseconds."},{"module":"crowdy_client_sdk::api","name":"emit_channel","kind":"function","signature":"pub fn emit_channel(channel_id: &str, payload_base64: &str) -> Result<Value, HostError>","docs":"Posts to one of the grid's channels."},{"module":"crowdy_client_sdk::api","name":"emit_event","kind":"function","signature":"pub fn emit_event(name: &str, payload: Value) -> Result<Value, HostError>","docs":"Publishes an event on the page's grid event bus, which the other CLIENT mods of this grid on the same page receive through `on_event`. Nothing leaves the page."},{"module":"crowdy_client_sdk::api","name":"emit_event_to","kind":"function","signature":"pub fn emit_event_to(target: &str, name: &str, payload: Value) -> Result<Value, HostError>","docs":"[`emit_event`] addressed to one mod on the bus by name, whether or not it listens for `name`."},{"module":"crowdy_client_sdk::api","name":"emit_spatial","kind":"function","signature":"pub fn emit_spatial( kind: &str, chunk: (i64, i64, i64), uuid_hex: &str, payload_base64: &str, distance: u8, decay: u8, ) -> Result<Value, HostError>","docs":"Sends a spatial message from a chunk inside the grid, as the visiting player's client. `kind` is `actor`, `client_event`, `server_event` or `text`; `uuid_hex` is 64 hex characters; `distance` is at most 8."},{"module":"crowdy_client_sdk::api","name":"events_poll","kind":"function","signature":"pub fn events_poll() -> Result<Value, HostError>","docs":"ClientEvents the visiting player's session has received since the last poll."},{"module":"crowdy_client_sdk::api","name":"grid_info","kind":"function","signature":"pub fn grid_info() -> Result<Value, HostError>","docs":"The mod's own grid, answered by the broker: `{ low: {x,y,z}, high: {x,y,z} }` in chunk coordinates, as decimal strings."},{"module":"crowdy_client_sdk::api","name":"grid_permission_check","kind":"function","signature":"pub fn grid_permission_check( user_id: &str, grid_id: &str, permission_key: &str, ) -> Result<bool, HostError>","docs":"Whether the visiting player holds `permission_key` on this grid."},{"module":"crowdy_client_sdk::api","name":"hud_set","kind":"function","signature":"pub fn hud_set(payload: Value) -> Result<Value, HostError>","docs":"Hands `payload` to the game's HUD channel. The mod never touches the DOM; a game that offers no HUD answers `{ delivered: false }`."},{"module":"crowdy_client_sdk::api","name":"input_axes","kind":"function","signature":"pub fn input_axes() -> Result<Value, HostError>","docs":"The visiting player's movement axes, drained by the page: `{ x, y }`."},{"module":"crowdy_client_sdk::api","name":"input_key","kind":"function","signature":"pub fn input_key(code: &str) -> Result<Value, HostError>","docs":"Whether the visiting player is holding `code` (a `KeyboardEvent.code`)."},{"module":"crowdy_client_sdk::api","name":"input_look","kind":"function","signature":"pub fn input_look() -> Result<Value, HostError>","docs":"Pointer-look delta since the last poll: `{ dx, dy }`."},{"module":"crowdy_client_sdk::api","name":"overlay_draw","kind":"function","signature":"pub fn overlay_draw(payload: Value) -> Result<Value, HostError>","docs":"Hands `payload` to the game's overlay channel, as [`hud_set`] does."},{"module":"crowdy_client_sdk::api","name":"pointer_clicks","kind":"function","signature":"pub fn pointer_clicks() -> Result<Value, HostError>","docs":"Drains the mouse clicks queued since the last call: `{ nowMs, buttons, holdingMs, clicks }`. `buttons` is `MouseEvent.buttons` (1 = left held); `holdingMs` maps a button index to how long it has been held (`\"0\"` = left); each click is `{ t: \"down\"|\"up\", button, atMs, heldMs?, nx, ny }` in canvas coordinates from -1 to 1 (+ny up). Call it every tick."},{"module":"crowdy_client_sdk::api","name":"pose_get","kind":"function","signature":"pub fn pose_get() -> Result<Value, HostError>","docs":"The visiting player's body. The page answers from the mod's hold, or the walker."},{"module":"crowdy_client_sdk::api","name":"pose_release","kind":"function","signature":"pub fn pose_release() -> Result<Value, HostError>","docs":"Hands the visiting player's body back to the walker."},{"module":"crowdy_client_sdk::api","name":"pose_set","kind":"function","signature":"pub fn pose_set(pose: Value) -> Result<Value, HostError>","docs":"Moves the visiting player's body. A position outside the grid is refused."},{"module":"crowdy_client_sdk::api","name":"scene_catalog","kind":"function","signature":"pub fn scene_catalog(catalog: Value) -> Result<Value, HostError>","docs":"The mod's scene templates, kept in the page."},{"module":"crowdy_client_sdk::api","name":"scene_instances","kind":"function","signature":"pub fn scene_instances(instances: Value) -> Result<Value, HostError>","docs":"Template instances drawn in the page, inside the grid."},{"module":"crowdy_client_sdk::api","name":"send_actor_message","kind":"function","signature":"pub fn send_actor_message(actor_id: &str, payload: Value) -> Result<Value, HostError>","docs":"A message from this session to one actor inside the grid."},{"module":"crowdy_client_sdk::api","name":"send_channel_message","kind":"function","signature":"pub fn send_channel_message(channel_id: &str, payload: Value) -> Result<Value, HostError>","docs":"A channel message as the visiting player, on a channel they may send on."},{"module":"crowdy_client_sdk::api","name":"send_client_event","kind":"function","signature":"pub fn send_client_event(chunk: (i64, i64, i64), payload: Value) -> Result<Value, HostError>","docs":"A ClientEvent from the visiting player's chunk, inside the grid."},{"module":"crowdy_client_sdk::api","name":"send_text","kind":"function","signature":"pub fn send_text(chunk: (i64, i64, i64), text: &str) -> Result<Value, HostError>","docs":"A spatial text packet from the visiting player's chunk."},{"module":"crowdy_client_sdk::api","name":"teleport_request","kind":"function","signature":"pub fn teleport_request(destination: Value) -> Result<Value, HostError>","docs":"Asks the page to move the visiting player to a destination inside the grid."},{"module":"crowdy_client_sdk::api","name":"user_state_get","kind":"function","signature":"pub fn user_state_get(user_id: &str) -> Result<Value, HostError>","docs":"The visiting player's app state."},{"module":"crowdy_client_sdk::api","name":"user_state_set","kind":"function","signature":"pub fn user_state_set(user_id: &str, state_base64: &str) -> Result<Value, HostError>","docs":"Replaces the visiting player's app state; `state_base64` is the new bytes."},{"module":"crowdy_client_sdk::api","name":"video_set","kind":"function","signature":"pub fn video_set(enabled: bool) -> Result<Value, HostError>","docs":"Starts or stops the visiting player's camera. The page still asks the browser."},{"module":"crowdy_client_sdk::api","name":"voice_set","kind":"function","signature":"pub fn voice_set(enabled: bool) -> Result<Value, HostError>","docs":"Starts or stops the visiting player's microphone. The page still asks the browser."},{"module":"crowdy_client_sdk::api","name":"voxel_set","kind":"function","signature":"pub fn voxel_set( chunk: (i64, i64, i64), voxel: (u8, u8, u8), voxel_type: i32, state_base64: Option<&str>, ) -> Result<Value, HostError>","docs":"Writes one voxel inside the grid, as the visiting player (their `update_voxel_data`)."},{"module":"crowdy_client_sdk::api","name":"voxels_list","kind":"function","signature":"pub fn voxels_list(x: i64, y: i64, z: i64) -> Result<Value, HostError>","docs":"The voxels recorded in one chunk inside the grid."},{"module":"crowdy_client_sdk::host","name":"host_call","kind":"function","signature":"pub fn host_call(ptr: *const u8, len: u32) -> u64;","docs":"The host-call gateway: a JSON request in guest memory, answered synchronously with a packed (resp_ptr << 32 | resp_len) JSON response that the guest frees."},{"module":"crowdy_client_sdk::host","name":"log","kind":"function","signature":"pub fn log(level: u32, ptr: *const u8, len: u32);","docs":"level: 0 debug, 1 info, 2 warn, 3 error."},{"module":"crowdy_client_sdk::host","name":"now_ms","kind":"function","signature":"pub fn now_ms() -> u64;","docs":"Milliseconds since the Unix epoch, from the browser's clock."},{"module":"crowdy_client_sdk::host","name":"state_get","kind":"function","signature":"pub fn state_get(dest: *mut u8, cap: u32) -> u32;","docs":"Copies up to `cap` bytes of the state blob into `dest` and returns the blob's full length (call with `cap = 0` to size it)."},{"module":"crowdy_client_sdk::host","name":"state_set","kind":"function","signature":"pub fn state_set(ptr: *const u8, len: u32) -> u32;","docs":"Replaces the state blob. Returns 0."}]}
|