blob: b275cce0f3fd6d5ab8c394bfc5bf53f6e56ad9dd [file] [log] [blame]
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
use crate::transport::Transport;
use anyhow::Result;
use erased_serde::Serialize;
pub use opentitantool_derive::*;
/// The `CommandDispatch` trait should be implemented for all leaf structures
/// in the application's command hierarchy. It can be automatically derived
/// on internal nodes in the heirarchy. See the documentation for
/// [`opentitantool_derive`].
pub trait CommandDispatch {
fn run(&self, transport: &mut dyn Transport) -> Result<Option<Box<dyn Serialize>>>;
}