Download binaries/cli/src/template/rust/node/main-template.rs from TomPei/csg-robomaster: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/datasets/TomPei/csg-robomaster/resolve/main/binaries/cli/src/template/rust/node/main-template.rs
- Command line
-
hf download hf://datasets/TomPei/csg-robomaster/binaries/cli/src/template/rust/node/main-template.rs
-
curl -L -o main-template.rs https://huggingface.co/datasets/TomPei/csg-robomaster/resolve/main/binaries/cli/src/template/rust/node/main-template.rs
496 Bytes
| use dora_node_api::{DoraNode, Event}; | |
| use std::error::Error; | |
| fn main() -> Result<(), Box<dyn Error>> { | |
| let (mut node, mut events) = DoraNode::init_from_env()?; | |
| while let Some(event) = events.recv() { | |
| match event { | |
| Event::Input { | |
| id, | |
| metadata, | |
| data: _, | |
| } => match id.as_str() { | |
| other => eprintln!("Received input `{other}`"), | |
| }, | |
| _ => {} | |
| } | |
| } | |
| Ok(()) | |
| } | |