Skip to content

Commit

Permalink
Fix: engine::new() visibility (#854)
Browse files Browse the repository at this point in the history
* fix: engine `new` visibility
  • Loading branch information
kinrezC authored Feb 7, 2024
1 parent ad701cb commit bbf5868
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 0 additions & 4 deletions arbiter-engine/src/examples/timed_message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ fn default_max_count() -> Option<u64> {
Some(3)
}

fn default_max_count() -> Option<u64> {
Some(3)
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct TimedMessage {
delay: u64,
Expand Down
2 changes: 1 addition & 1 deletion arbiter-engine/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ where
E: DeserializeOwned + Send + Sync + 'static,
{
/// Creates a new [`Engine`] with the given [`Behavior`] and [`Receiver`].
pub(crate) fn new(behavior: B) -> Self {
pub fn new(behavior: B) -> Self {
Self {
behavior: Some(behavior),
state: State::Uninitialized,
Expand Down
1 change: 1 addition & 0 deletions arbiter-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "arbiter-macros"
version = "0.1.0"

[lib]
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/usage/arbiter_engine/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The goal of this crate is to abstract away the work required to set up agents, their behaviors, and the worlds they live in.
At the moment, all interaction of agents is done through the `arbiter-core` crate and is meant to be for local simulations and it is not yet generalized for the case of live network automation.

## Heirarchy
## Hierarchy
The primary components of `arbiter-engine` are, from the bottom up:
- `Behavior<E>`: This is an event-driven behavior that takes in some item of type `E` and can act on that.
The `Behavior<E>` has two methods: `startup` and `process`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn setup_world(id: &str) -> World {
world.add_agent(agent);
}

fn main() {
async fn run() {
let world = setup_world("my_world");
world.run().await;
}
Expand All @@ -82,4 +82,4 @@ fn main() {
universe.add_world(setup_world("my_other_world"));
universe.run_worlds().await;
}
```
```

0 comments on commit bbf5868

Please sign in to comment.