Skip to content

Commit ae99aa3

Browse files
committed
nectar->kinode
1 parent b339572 commit ae99aa3

File tree

12 files changed

+54
-54
lines changed

12 files changed

+54
-54
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[submodule "nectar-wit"]
2-
path = nectar-wit
3-
url = https://github.com/uqbar-dao/nectar-wit.git
1+
[submodule "kinode-wit"]
2+
path = kinode-wit
3+
url = https://github.com/uqbar-dao/kinode-wit.git
44
branch = master

Cargo.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "nectar_process_lib"
2+
name = "kinode_process_lib"
33
version = "0.5.0"
44
edition = "2021"
55

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# process_lib
22

3-
Library of functions for more ergonomic Nectar process development.
3+
Library of functions for more ergonomic kinode process development.
44

55
To develop/build:
66
```
7-
git submodule add https://github.com/uqbar-dao/nectar-wit.git
7+
git submodule add https://github.com/uqbar-dao/kinode-wit.git
88
```
99

1010
Docs: (TODO link)

nectar-wit renamed to kinode-wit

src/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ where
329329
local_only,
330330
cache: true,
331331
})?)
332-
.blob(crate::nectar::process::standard::LazyLoadBlob {
332+
.blob(crate::kinode::process::standard::LazyLoadBlob {
333333
mime: content_type,
334334
bytes: content,
335335
})

src/kernel_types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
use crate::nectar::process::standard as wit;
1+
use crate::kinode::process::standard as wit;
22
use crate::{Address, ProcessId};
33
use serde::{Deserialize, Serialize};
44
use std::collections::HashSet;
55

66
//
77
// process-facing kernel types, used for process
88
// management and message-passing
9-
// matches types in nectar.wit
9+
// matches types in kinode.wit
1010
//
1111

1212
pub type Context = Vec<u8>;

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//! Nectar process standard library for Rust compiled to WASM
2-
//! Must be used in context of bindings generated by `nectar.wit`.
1+
//! kinode process standard library for Rust compiled to WASM
2+
//! Must be used in context of bindings generated by `kinode.wit`.
33
//!
4-
//! This library provides a set of functions for interacting with the Nectar
4+
//! This library provides a set of functions for interacting with the kinode
55
//! kernel interface, which is a WIT file. The types generated by this file
66
//! are available in processes via the wit_bindgen macro, if a process needs
77
//! to use them directly. However, the most convenient way to do most things
@@ -13,11 +13,11 @@
1313
//! for applications that want to maximize composability and introspectability.
1414
//! For blobs, we recommend bincode to serialize and deserialize to bytes.
1515
//!
16-
pub use crate::nectar::process::standard::*;
16+
pub use crate::kinode::process::standard::*;
1717
use serde::{Deserialize, Serialize};
1818

1919
wit_bindgen::generate!({
20-
path: "nectar-wit",
20+
path: "kinode-wit",
2121
world: "lib",
2222
});
2323

@@ -101,8 +101,8 @@ pub fn await_message() -> Result<Message, SendError> {
101101
Ok((source, message)) => Ok(wit_message_to_message(source, message)),
102102
Err((send_err, context)) => Err(SendError {
103103
kind: match send_err.kind {
104-
crate::nectar::process::standard::SendErrorKind::Offline => SendErrorKind::Offline,
105-
crate::nectar::process::standard::SendErrorKind::Timeout => SendErrorKind::Timeout,
104+
crate::kinode::process::standard::SendErrorKind::Offline => SendErrorKind::Offline,
105+
crate::kinode::process::standard::SendErrorKind::Timeout => SendErrorKind::Timeout,
106106
},
107107
message: wit_message_to_message(
108108
Address::new("our", ProcessId::new(Some("net"), "distro", "sys")),
@@ -123,7 +123,7 @@ pub fn spawn(
123123
grant_capabilities: Vec<ProcessId>,
124124
public: bool,
125125
) -> Result<ProcessId, SpawnError> {
126-
crate::nectar::process::standard::spawn(
126+
crate::kinode::process::standard::spawn(
127127
name,
128128
wasm_path,
129129
&on_exit._to_standard().map_err(|_e| SpawnError::NameTaken)?,

src/message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,17 @@ impl std::error::Error for SendError {
131131

132132
pub fn wit_message_to_message(
133133
source: Address,
134-
message: crate::nectar::process::standard::Message,
134+
message: crate::kinode::process::standard::Message,
135135
) -> Message {
136136
match message {
137-
crate::nectar::process::standard::Message::Request(req) => Message::Request {
137+
crate::kinode::process::standard::Message::Request(req) => Message::Request {
138138
source,
139139
expects_response: req.expects_response,
140140
body: req.body,
141141
metadata: req.metadata,
142142
capabilities: req.capabilities,
143143
},
144-
crate::nectar::process::standard::Message::Response((resp, context)) => Message::Response {
144+
crate::kinode::process::standard::Message::Response((resp, context)) => Message::Response {
145145
source,
146146
body: resp.body,
147147
metadata: resp.metadata,

src/on_exit.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ pub enum OnExit {
1010
impl OnExit {
1111
/// Call the kernel to get the current set OnExit behavior
1212
pub fn get() -> Self {
13-
match crate::nectar::process::standard::get_on_exit() {
14-
crate::nectar::process::standard::OnExit::None => OnExit::None,
15-
crate::nectar::process::standard::OnExit::Restart => OnExit::Restart,
16-
crate::nectar::process::standard::OnExit::Requests(reqs) => {
13+
match crate::kinode::process::standard::get_on_exit() {
14+
crate::kinode::process::standard::OnExit::None => OnExit::None,
15+
crate::kinode::process::standard::OnExit::Restart => OnExit::Restart,
16+
crate::kinode::process::standard::OnExit::Requests(reqs) => {
1717
let mut requests: Vec<Request> = Vec::with_capacity(reqs.len());
1818
for req in reqs {
1919
requests.push(Request {
@@ -76,25 +76,25 @@ impl OnExit {
7676
}
7777
/// Set the OnExit behavior for this process
7878
pub fn set(self) -> anyhow::Result<()> {
79-
crate::nectar::process::standard::set_on_exit(&self._to_standard()?);
79+
crate::kinode::process::standard::set_on_exit(&self._to_standard()?);
8080
Ok(())
8181
}
8282
/// Convert this OnExit to the kernel's OnExit type
83-
pub fn _to_standard(self) -> anyhow::Result<crate::nectar::process::standard::OnExit> {
83+
pub fn _to_standard(self) -> anyhow::Result<crate::kinode::process::standard::OnExit> {
8484
match self {
85-
OnExit::None => Ok(crate::nectar::process::standard::OnExit::None),
86-
OnExit::Restart => Ok(crate::nectar::process::standard::OnExit::Restart),
85+
OnExit::None => Ok(crate::kinode::process::standard::OnExit::None),
86+
OnExit::Restart => Ok(crate::kinode::process::standard::OnExit::Restart),
8787
OnExit::Requests(reqs) => {
8888
let mut kernel_reqs: Vec<(
8989
Address,
90-
nectar::process::standard::Request,
90+
kinode::process::standard::Request,
9191
Option<LazyLoadBlob>,
9292
)> = Vec::with_capacity(reqs.len());
9393
for req in reqs {
9494
kernel_reqs.push((
9595
req.target
9696
.ok_or(anyhow::anyhow!("request without target given"))?,
97-
nectar::process::standard::Request {
97+
kinode::process::standard::Request {
9898
inherit: req.inherit,
9999
expects_response: None,
100100
body: req
@@ -106,7 +106,7 @@ impl OnExit {
106106
req.blob,
107107
));
108108
}
109-
Ok(crate::nectar::process::standard::OnExit::Requests(
109+
Ok(crate::kinode::process::standard::OnExit::Requests(
110110
kernel_reqs,
111111
))
112112
}

0 commit comments

Comments
 (0)