tracexec-core 1.0.0-alpha.1

Core crate of tracexec [Internal implementation! DO NOT DEPEND ON!]
Documentation
use std::{
  io::Write,
  sync::Arc,
};

use tokio::sync::mpsc::UnboundedReceiver;

use crate::{
  cli::args::ExporterArgs,
  event::TracerMessage,
  proc::BaselineInfo,
};

pub struct ExporterMetadata {
  pub baseline: Arc<BaselineInfo>,
  pub exporter_args: ExporterArgs,
}

pub trait Exporter: Sized {
  type Error;

  fn new(
    output: Box<dyn Write + Send + Sync + 'static>,
    meta: ExporterMetadata,
    stream: UnboundedReceiver<TracerMessage>,
  ) -> Result<Self, Self::Error>;

  #[allow(async_fn_in_trait)]
  async fn run(self) -> Result<i32, Self::Error>;
}