From e5f4f90ac6eac2613dac235b6f0a55ba857cfd2c Mon Sep 17 00:00:00 2001 From: Mike Manfredi Date: Wed, 2 Oct 2024 18:41:15 +0000 Subject: [PATCH] cleaned up chicken scratch and prepped for demo --- .../rust-service/reference/chicken-scratch.md | 4 ++-- .../services/basic-w-query/src/lib.rs | 13 +++++++++---- rust/psibase-macros-test/src/lib.rs | 6 +++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/psidk/src/development/services/rust-service/reference/chicken-scratch.md b/doc/psidk/src/development/services/rust-service/reference/chicken-scratch.md index e462a11f7..fa69a9e9f 100644 --- a/doc/psidk/src/development/services/rust-service/reference/chicken-scratch.md +++ b/doc/psidk/src/development/services/rust-service/reference/chicken-scratch.md @@ -19,7 +19,7 @@ Note: some doc updates are done here simply because we're more intersted in capt #### Singleton Tables -[Current doc on Singletons](development/services/rust-service/tables.html#singletons) uses in-place code, rather than a generalized, explicit Singleton construct. Probably worth defining a `Singleton` thing that makes it explicit what's happening. Could be a type def, a struct, or some kind of Trait or Key type. +[Current doc on Singletons](../tables.md) uses in-place code, rather than a generalized, explicit Singleton construct. Probably worth defining a `Singleton` thing that makes it explicit what's happening. Could be a type def, a struct, or some kind of Trait or Key type. The code snippets I think could be improved are as follows: @@ -41,7 +41,7 @@ let mut lastUsed = #### Externalizing Table definitions and their structs / Code Splitting -The basic Table docs for "[Storing Structs Defined Elsewhere](development/services/rust-service/tables.html#storing-structs-defined-elsewhere)" are outdated. +The basic Table docs for "[Storing Structs Defined Elsewhere](../tables.html)" are outdated. 1. `Reflect` doesn't seem to exist. 2. using the documented `impl WrapMessage { ... }` doesn't seem to work anymore. Updated doc that I believe accomplishes the same thing is below. diff --git a/rust/psibase-macros-test/services/basic-w-query/src/lib.rs b/rust/psibase-macros-test/services/basic-w-query/src/lib.rs index 1fc87316d..196439bf6 100644 --- a/rust/psibase-macros-test/services/basic-w-query/src/lib.rs +++ b/rust/psibase-macros-test/services/basic-w-query/src/lib.rs @@ -1,12 +1,17 @@ #[psibase::service(name = "basicwquery")] #[allow(non_snake_case)] mod service { - // FOR DEMO vvv Used by event definition use psibase::{ - anyhow, serve_content, serve_simple_ui, HttpReply, HttpRequest, Table, WebContentRow, + // FOR DEMO vvv Used by event definition + anyhow, + // FOR DEMO ^^^ + serve_content, + serve_simple_ui, + HttpReply, + HttpRequest, + Table, + WebContentRow, }; - // use psibase::anyhow; - // FOR DEMO ^^^ #[table(record = "WebContentRow", index = 0)] struct WebContentTable; diff --git a/rust/psibase-macros-test/src/lib.rs b/rust/psibase-macros-test/src/lib.rs index 77cfe3a7e..cc4b2385f 100644 --- a/rust/psibase-macros-test/src/lib.rs +++ b/rust/psibase-macros-test/src/lib.rs @@ -1,6 +1,6 @@ -// #[psibase::service] -// #[allow(non_snake_case)] -// mod service {} +#[psibase::service] +#[allow(non_snake_case)] +mod service {} mod tests {