From fa4436771cc922a9131126fd42aec838e93898e5 Mon Sep 17 00:00:00 2001 From: FantasyPvP <80643031+FantasyPvP@users.noreply.github.com> Date: Mon, 13 Nov 2023 00:23:20 +0000 Subject: [PATCH] Created Crystal API (markdown) --- Crystal-API.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Crystal-API.md diff --git a/Crystal-API.md b/Crystal-API.md new file mode 100644 index 0000000..d4e3a77 --- /dev/null +++ b/Crystal-API.md @@ -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) -> Result<(), Error> { + Ok(()) + } +} + +#[derive(Debug)] +pub enum Error { + UnknownCommand(String), + CommandFailed(String), + ApplicationError(String), + EmptyCommand, +} + +``` \ No newline at end of file