Skip to content
Merged
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
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.

11 changes: 11 additions & 0 deletions src/kernel_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ pub struct PackageManifestEntry {
pub public: bool,
}

/// the type that gets deserialized from a `scripts.json` object
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DotScriptsEntry {
pub root: bool,
pub public: bool,
pub request_networking: bool,
pub request_capabilities: Option<Vec<serde_json::Value>>,
pub grant_capabilities: Option<Vec<serde_json::Value>>,
}

impl std::fmt::Display for Message {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,10 @@ pub fn get_capability(our: &Address, params: &str) -> Option<Capability> {
})
.cloned()
}

pub fn await_next_request_body() -> anyhow::Result<Vec<u8>> {
let Ok(Message::Request { body, .. }) = await_message() else {
return Err(anyhow::anyhow!("failed to get request body, bailing out"));
};
Ok(body)
}