Initial node implementation #4

Merged
zack merged 51 commits from develop into master 2023-07-19 18:09:13 +00:00
11 changed files with 166 additions and 44 deletions
Showing only changes of commit feebce2b07 - Show all commits

View File

@ -16,19 +16,29 @@ license = "MIT"
[workspace.dependencies]
##### no-std #####
# General utility
thiserror = "1.0.*"
# Error handling
[workspace.dependencies.thiserror]
version = "1.0.*"
# Concurrency
[workspace.dependencies.crossbeam]
version = "0.8.*"
default-features = false
# Units of measurement
uom = "0.34.*"
[workspace.dependencies.uom]
version = "0.34.*"
# Logging
tracing = "0.1.*"
[workspace.dependencies.tracing]
version = "0.1.*"
# Serialization
parity-scale-codec = "3.4.*"
[workspace.dependencies.parity-scale-codec]
version = "3.4.*"
##### std #####
# Async
futures-lite = "1.12.*"
async-io = "1.13.*"
[workspace.dependencies.futures-lite]
version = "1.13.*"
[workspace.dependencies.async-io]
version = "1.13.*"
[package]
name = "physical"
@ -40,6 +50,7 @@ readme.workspace = true
license.workspace = true
[dependencies]
thiserror.workspace = true
uom.workspace = true
parity-scale-codec.workspace = true
thiserror = { workspace = true }
crossbeam = { workspace = true }
uom = { workspace = true }
parity-scale-codec = { workspace = true }

View File

@ -11,3 +11,9 @@ impl<'a, T: Copy> CellView<'a, T> {
self.0.get()
}
}
impl<'a, T: Copy> From<&'a Cell<T>> for CellView<'a, T> {
fn from(value: &'a Cell<T>) -> Self {
CellView(value)
}
}

View File

@ -1,14 +1 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
mod cell;

View File

@ -1,3 +1,8 @@
imports_granularity="Module"
format_strings=true
wrap_comments=true
match_block_trailing_comma=true
enum_discrim_align_threshold=25
fn_call_width=100
comment_width=100
single_line_if_else_max_width=100

View File

@ -1,3 +1,2 @@
#![no_std]
mod cell;