Skip to content

Commit c5b7296

Browse files
committed
chore create lib
0 parents  commit c5b7296

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "ledswarm_protocol"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]

src/lib.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pub fn add(left: usize, right: usize) -> usize {
2+
left + right
3+
}
4+
5+
pub enum Message {
6+
/// Initiate a WebSocket session with the master node.
7+
Hello,
8+
/// Terminate the socket session.
9+
Farewell,
10+
/// Synchronize controller time.
11+
Tick(u16),
12+
}
13+
14+
#[cfg(test)]
15+
mod tests {
16+
use super::*;
17+
18+
#[test]
19+
fn it_works() {
20+
let result = add(2, 2);
21+
assert_eq!(result, 4);
22+
}
23+
}

0 commit comments

Comments
 (0)