#[cfg(feature = "debugger")]
use serde_json::Value;
use flowcore::errors::*;
#[cfg(feature = "debugger")]
use flowcore::model::input::Input;
#[cfg(feature = "metrics")]
use flowcore::model::metrics::Metrics;
#[cfg(feature = "debugger")]
use flowcore::model::output_connection::OutputConnection;
#[cfg(feature = "debugger")]
use flowcore::model::runtime_function::RuntimeFunction;
use flowcore::model::submission::Submission;
#[cfg(feature = "debugger")]
use crate::block::Block;
#[cfg(feature = "debugger")]
use crate::debug_command::DebugCommand;
#[cfg(feature = "debugger")]
use crate::job::Job;
use crate::run_state::RunState;
#[cfg(feature = "debugger")]
use crate::run_state::State;
pub trait SubmissionProtocol {
fn flow_execution_starting(&mut self) -> Result<()>;
#[cfg(feature = "debugger")]
fn should_enter_debugger(&mut self) -> Result<bool>;
#[cfg(feature = "metrics")]
fn flow_execution_ended(&mut self, state: &RunState, metrics: Metrics) -> Result<()>;
#[cfg(not(feature = "metrics"))]
fn flow_execution_ended(&mut self, state: &RunState) -> Result<()>;
fn wait_for_submission(&mut self) -> Result<Option<Submission>>;
fn coordinator_is_exiting(&mut self, result: Result<()>) -> Result<()>;
}
#[cfg(feature = "debugger")]
pub trait DebuggerProtocol {
fn start(&mut self);
fn job_breakpoint(&mut self, job: &Job, function: &RuntimeFunction, states: Vec<State>);
fn block_breakpoint(&mut self, block: &Block);
fn flow_unblock_breakpoint(&mut self, flow_id: usize);
#[allow(clippy::too_many_arguments)]
fn send_breakpoint(&mut self, source_function_name: &str, source_function_id: usize,
output_route: &str, value: &Value, destination_id: usize,
destination_name: &str, io_name: &str, input_number: usize);
fn job_error(&mut self, job: &Job);
fn job_completed(&mut self, job: &Job);
fn blocks(&mut self, blocks: Vec<Block>);
fn outputs(&mut self, output: Vec<OutputConnection>);
fn input(&mut self, input: Input);
fn function_list(&mut self, functions: &[RuntimeFunction]);
fn function_states(&mut self, function: RuntimeFunction, function_states: Vec<State>);
fn run_state(&mut self, run_state: &RunState);
fn message(&mut self, message: String);
fn panic(&mut self, state: &RunState, error_message: String);
fn debugger_exiting(&mut self);
fn debugger_resetting(&mut self);
fn debugger_error(&mut self, error: String);
fn execution_starting(&mut self);
fn execution_ended(&mut self);
fn get_command(&mut self, state: &RunState) -> Result<DebugCommand>;
}