aboutsummaryrefslogtreecommitdiff
path: root/examples/basalt.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-14 14:54:48 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-14 16:11:07 +0200
commit8a0bfa0ff6bc6b79c91c8e635dd00c2f687ec401 (patch)
tree15179701a037f4eeb39a61f68ea723f26ae899c5 /examples/basalt.rs
parentfba49cf93dedae21cbe884db8c0124c0d3c88730 (diff)
downloadnetapp-8a0bfa0ff6bc6b79c91c8e635dd00c2f687ec401.tar.gz
netapp-8a0bfa0ff6bc6b79c91c8e635dd00c2f687ec401.zip
Change call() to take a ref to the message to be sent
Handlers also receive a ref
Diffstat (limited to 'examples/basalt.rs')
-rw-r--r--examples/basalt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/basalt.rs b/examples/basalt.rs
index 752583d..5628056 100644
--- a/examples/basalt.rs
+++ b/examples/basalt.rs
@@ -145,7 +145,7 @@ impl Example {
tokio::spawn(async move {
match self2
.example_endpoint
- .call(&p, ExampleMessage { example_field: 42 }, PRIO_NORMAL)
+ .call(&p, &ExampleMessage { example_field: 42 }, PRIO_NORMAL)
.await
{
Ok(resp) => debug!("Got example response: {:?}", resp),
@@ -159,7 +159,7 @@ impl Example {
#[async_trait]
impl EndpointHandler<ExampleMessage> for Example {
- async fn handle(self: &Arc<Self>, msg: ExampleMessage, _from: NodeID) -> ExampleResponse {
+ async fn handle(self: &Arc<Self>, msg: &ExampleMessage, _from: NodeID) -> ExampleResponse {
debug!("Got example message: {:?}, sending example response", msg);
ExampleResponse {
example_field: false,