Download binaries/cli/src/template/rust/operator/lib-template.rs from TomPei/csg-robomaster: direct link, hf CLI and curl.
- Browser
- Download file 618 Bytes
-
https://huggingface.co/datasets/TomPei/csg-robomaster/resolve/main/binaries/cli/src/template/rust/operator/lib-template.rs
- Command line
-
hf download hf://datasets/TomPei/csg-robomaster/binaries/cli/src/template/rust/operator/lib-template.rs
-
curl -L -o lib-template.rs https://huggingface.co/datasets/TomPei/csg-robomaster/resolve/main/binaries/cli/src/template/rust/operator/lib-template.rs
618 Bytes
| use dora_operator_api::{register_operator, DoraOperator, DoraOutputSender, DoraStatus, Event}; | |
| register_operator!(ExampleOperator); | |
| struct ExampleOperator { | |
| example_field: u32, | |
| } | |
| impl DoraOperator for ExampleOperator { | |
| fn on_event( | |
| &mut self, | |
| event: &Event, | |
| output_sender: &mut DoraOutputSender, | |
| ) -> Result<DoraStatus, String> { | |
| match event { | |
| Event::Input { id, data } => match id { | |
| other => eprintln!("Received input {other}"), | |
| }, | |
| _ => {} | |
| } | |
| Ok(DoraStatus::Continue) | |
| } | |
| } | |