Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "hyperprocess_macro"
name = "hyperapp_macro"
version = "0.1.0"
edition = "2021"

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hyperware Process Framework
# Hyperapp Framework

![How it feels to use Hyperware](hyperware.jpg)
How it feels to use hyperware
Expand All @@ -9,7 +9,7 @@ How it feels to use hyperware
- [Overview](#overview)
- [Getting Started](#getting-started)
- [State Management](#state-management)
- [Hyperprocess Macro Parameters](#hyperprocess-macro-parameters)
- [Hyperapp Macro Parameters](#hyperapp-macro-parameters)
- [Handler Types](#handler-types)
- [Special Methods](#special-methods)
- [Init Method](#init-method)
Expand Down Expand Up @@ -57,7 +57,7 @@ So this includes:
To create a Hyperware process, you need to:

1. Define your process state as a struct
2. Implement the struct with the `hyperprocess` macro
2. Implement the struct with the `hyperapp` macro
3. Define handlers for different types of requests

Here's a minimal example:
Expand All @@ -68,7 +68,7 @@ struct MyProcessState {
counter: u64,
}

#[hyperprocess(
#[hyperapp(
name = "My Process",
ui = Some(HttpBindingConfig::default()),
endpoints = vec![
Expand Down Expand Up @@ -100,7 +100,7 @@ Your state should implement the `Default` and `State` traits, and be serializabl

### Hyperprocess Macro Parameters

The `hyperprocess` macro accepts the following parameters:
The `hyperapp` macro accepts the following parameters:

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
Expand All @@ -115,7 +115,7 @@ The `hyperprocess` macro accepts the following parameters:
Example:

```rust
#[hyperprocess(
#[hyperapp(
name = "Async Requester",
ui = Some(HttpBindingConfig::default()),
endpoints = vec![
Expand Down Expand Up @@ -304,7 +304,7 @@ async fn async_handler(&mut self, data: MyData) -> Result<String, String> {
You can bind HTTP handlers to specific paths using the `path` parameter:

```rust
#[hyperprocess(
#[hyperapp(
endpoints = vec![
Binding::Http { path: "/api", config: HttpBindingConfig::default() },
Binding::Http { path: "/admin", config: HttpBindingConfig::default() }
Expand Down Expand Up @@ -489,7 +489,7 @@ struct AsyncRequesterState {
request_count: u64,
}

#[hyperprocess(
#[hyperapp(
name = "Async Requester",
ui = Some(HttpBindingConfig::default()),
endpoints = vec![
Expand Down Expand Up @@ -666,7 +666,7 @@ The macro catches configuration errors at compile time:

```rust
// This will fail to compile:
#[hyperprocess(
#[hyperapp(
name = "test-app",
// Missing required 'endpoints' parameter
save_config = SaveOptions::Never,
Expand Down Expand Up @@ -1010,7 +1010,7 @@ This was achieved by implementing our own async runtime. Given that processes ar

### Macro Implementation

The `hyperprocess` macro transforms a struct implementation into a fully-featured process:
The `hyperapp` macro transforms a struct implementation into a fully-featured process:

#### 1. Parsing Phase

Expand Down Expand Up @@ -1452,14 +1452,14 @@ graph TB
%% BUILD PHASE - Where components are generated
subgraph BuildPhase["⚙️ BUILD PHASE"]
UserSrc[/"User Source Code
#[hyperprocess] macro
#[hyperapp] macro
#[http], #[local], #[remote] methods"/]

subgraph CodeGen["Code Generation Pipeline"]
direction TB

HyperBindgen["hyper-bindgen CLI
Scans for #[hyperprocess]"]
Scans for #[hyperapp]"]

subgraph BindgenOutputs["hyper-bindgen Outputs"]
direction LR
Expand All @@ -1471,7 +1471,7 @@ graph TB
Cross-process types"]
end

ProcMacro["hyperprocess Macro
ProcMacro["hyperapp Macro
AST Transformation"]

subgraph MacroOutputs["Macro Generated Code"]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ fn generate_component_impl(

/// The main procedural macro
#[proc_macro_attribute]
pub fn hyperprocess(attr: TokenStream, item: TokenStream) -> TokenStream {
pub fn hyperapp(attr: TokenStream, item: TokenStream) -> TokenStream {
// Parse the input
let attr_args = parse_macro_input!(attr as MetaList);
let impl_block = parse_macro_input!(item as ItemImpl);
Expand Down