Skip to content

Commit

Permalink
Rust docs (#17)
Browse files Browse the repository at this point in the history
* Rust docs

* Fix doc test
  • Loading branch information
slinkydeveloper authored Aug 22, 2024
1 parent a08ee31 commit b2fdbaf
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Documentation](https://img.shields.io/badge/doc-reference-blue)](https://docs.restate.dev)
[![Documentation](https://img.shields.io/docsrs/restate-sdk)](https://docs.rs/restate-sdk)
[![crates.io](https://img.shields.io/crates/v/restate_sdk.svg)](https://crates.io/crates/restate-sdk/)
[![Examples](https://img.shields.io/badge/view-examples-blue)](https://github.com/restatedev/examples)
[![Discord](https://img.shields.io/discord/1128210118216007792?logo=discord)](https://discord.gg/skW3AZ6uGd)
Expand Down
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ print-target:
test: (_target-installed target)
cargo nextest run {{ _target-option }} --all-features

doctest:
cargo test --doc

# Runs lints and tests
verify: lint test
verify: lint test doctest

udeps *flags:
RUSTC_BOOTSTRAP=1 cargo udeps --all-features --all-targets {{ flags }}
Expand Down
4 changes: 2 additions & 2 deletions macros/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

//! Some parts copied from https://github.com/dtolnay/thiserror/blob/39aaeb00ff270a49e3c254d7b38b10e934d3c7a5/impl/src/ast.rs
//! License Apache-2.0 or MIT
// Some parts copied from https://github.com/dtolnay/thiserror/blob/39aaeb00ff270a49e3c254d7b38b10e934d3c7a5/impl/src/ast.rs
// License Apache-2.0 or MIT

use syn::ext::IdentExt;
use syn::parse::{Parse, ParseStream};
Expand Down
7 changes: 5 additions & 2 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

//! Some parts of this codebase were taken from https://github.com/google/tarpc/blob/b826f332312d3702667880a464e247556ad7dbfe/plugins/src/lib.rs
//! License MIT
// Some parts of this codebase were taken from https://github.com/google/tarpc/blob/b826f332312d3702667880a464e247556ad7dbfe/plugins/src/lib.rs
// License MIT

extern crate proc_macro;

Expand All @@ -22,6 +22,7 @@ use proc_macro::TokenStream;
use quote::ToTokens;
use syn::parse_macro_input;

/// Entry-point macro to define a Restate service.
#[proc_macro_attribute]
pub fn service(_: TokenStream, input: TokenStream) -> TokenStream {
let svc = parse_macro_input!(input as Service);
Expand All @@ -31,6 +32,7 @@ pub fn service(_: TokenStream, input: TokenStream) -> TokenStream {
.into()
}

/// Entry-point macro to define a Restate object.
#[proc_macro_attribute]
pub fn object(_: TokenStream, input: TokenStream) -> TokenStream {
let svc = parse_macro_input!(input as Object);
Expand All @@ -40,6 +42,7 @@ pub fn object(_: TokenStream, input: TokenStream) -> TokenStream {
.into()
}

/// Entry-point macro to define a Restate workflow.
#[proc_macro_attribute]
pub fn workflow(_: TokenStream, input: TokenStream) -> TokenStream {
let svc = parse_macro_input!(input as Workflow);
Expand Down
Loading

0 comments on commit b2fdbaf

Please sign in to comment.