Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust client SDK quickstart for 1.0 API #162

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gefjon
Copy link
Contributor

@gefjon gefjon commented Feb 11, 2025

A whole bunch of stuff has changed since this document was last updated. Notably, I've chosen to re-order a bunch of sections, since the previous structure of the document doesn't make much sense after the 0.12 API rework.

Assuming this gets approved, we should likely copy these structural changes into the TS and C# versions as well.

@gefjon gefjon self-assigned this Feb 12, 2025
A whole bunch of stuff has changed since this document was last updated.
Notably, I've chosen to re-order a bunch of sections,
since the previous structure of the document doesn't make much sense
after the 0.12 API rework.
@gefjon gefjon changed the title WIP: Update Rust client SDK quickstart for 1.0 API Update Rust client SDK quickstart for 1.0 API Feb 24, 2025
@gefjon gefjon requested review from kazimuth and rekhoff February 24, 2025 15:51
@gefjon gefjon marked this pull request as ready for review February 24, 2025 15:51
Copy link
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read over document. It all makes sense and introduces the material well.

Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am following this quickstart as part of doing the release and I ran into a few simple issues. It currently doesn't build so please fix before merging:

Boppy@JASKIER MINGW64 ~/clockwork/quickstart-rust-sdk (master)
$ cargo run
   Compiling quickstart-rust-sdk v0.1.0 (C:\Users\Boppy\clockwork\quickstart-rust-sdk)
error[E0433]: failed to resolve: use of undeclared crate or module `credentials`
  --> src\main.rs:48:21
   |
48 | fn creds_store() -> credentials::File {
   |                     ^^^^^^^^^^^ use of undeclared crate or module `credentials`
   |
help: consider importing this module
   |
2  + use spacetimedb_sdk::credentials;
   |

error[E0433]: failed to resolve: use of undeclared crate or module `credentials`
  --> src\main.rs:49:5
   |
49 |     credentials::File::new("quickstart-chat")
   |     ^^^^^^^^^^^ use of undeclared crate or module `credentials`
   |
help: consider importing one of these structs
   |
2  + use std::fs::File;
   |
2  + use spacetimedb_sdk::credentials::File;
   |
help: if you import `File`, refer to it directly
   |
49 -     credentials::File::new("quickstart-chat")
49 +     File::new("quickstart-chat")
   |

warning: unused import: `spacetimedb_sdk::credentials::File`
 --> src\main.rs:3:5
  |
3 | use spacetimedb_sdk::credentials::File;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `ctx`
   --> src\main.rs:170:17
    |
170 | fn on_sub_error(ctx: &ErrorContext, err: Error) {
    |                 ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
    |
    = note: `#[warn(unused_variables)]` on by default

For more information about this error, try `rustc --explain E0433`.
warning: `quickstart-rust-sdk` (bin "quickstart-rust-sdk") generated 2 warnings
error: could not compile `quickstart-rust-sdk` (bin "quickstart-rust-sdk") due to 2 previous errors; 2 warnings emitted

There are still warnings here but it builds now
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After my edit this works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants