Created Crystal API (markdown)

FantasyPvP
2023-11-13 00:23:20 +00:00
parent 898f0a74b4
commit fa4436771c
+23
@@ -0,0 +1,23 @@
```rust
use async_trait::async_trait;
use alloc::{string::String, vec::Vec, boxed::Box};
#[async_trait]
pub trait Application {
fn new() -> Self;
async fn run(&mut self, _: Vec<String>) -> Result<(), Error> {
Ok(())
}
}
#[derive(Debug)]
pub enum Error {
UnknownCommand(String),
CommandFailed(String),
ApplicationError(String),
EmptyCommand,
}
```