drone-micropython-core 0.1.1

MicroPython for Drone.
#[cfg(feature = "io")]
use drone_core::ffi::CStr;
use exec::UncaughtException;

/// MicroPython commands.
pub struct Cmd(pub(crate) CmdKind);

pub(crate) enum CmdKind {
  ExecSource {
    source: *const str,
  },
  #[cfg(feature = "io")]
  ExecPath {
    path: *const CStr,
  },
}

/// MicroPython command results.
#[allow(unions_with_drop_fields)]
pub union CmdRes {
  pub(crate) exec_source: Result<(), UncaughtException>,
  #[cfg(feature = "io")]
  pub(crate) exec_path: Result<(), UncaughtException>,
}

unsafe impl Send for Cmd {}