use std::any::Any;
use std::marker::PhantomData;
use serde::Serialize;
use serde::de::DeserializeOwned;
use crate::diag::DiagArg;
use crate::registry::{
FromArgs, FromValue, IntoValue, Kind, Registry, RegistryError, VarHandle, YomiArgs, YomiType,
};
use crate::value::{Ty, Value};
use crate::vm::{Rng, VmErrorKind};
mod ctx;
mod error;
mod functions;
mod reg;
mod slice;
pub use ctx::*;
pub use error::*;
pub use functions::*;
pub use reg::*;
pub(crate) use slice::*;
pub trait Package: Sized + 'static {
const NAME: &'static str;
const VERSION: u32 = 1;
const STD: bool = false;
const DEPENDS: &'static [&'static str] = &[];
type State: Clone + Serialize + DeserializeOwned + Default + Send + Sync + 'static;
const PERSISTENT_VERSION: u32 = 1;
const RULES_VERSION: u32 = 1;
type Persistent: Clone + Serialize + DeserializeOwned + Default + Send + Sync + 'static;
fn register(reg: &mut PackageReg<'_, Self>);
fn clear_cues(state: &mut Self::State) {
let _ = state;
}
fn cue_len(state: &Self::State) -> usize {
let _ = state;
0
}
fn migrate(old_version: u32, raw: &[u8]) -> Result<Self::State, MigrateError> {
let _ = raw;
Err(MigrateError::unsupported_version(old_version))
}
fn migrate_persistent(old_version: u32, raw: &[u8]) -> Result<Self::Persistent, MigrateError> {
let _ = raw;
Err(MigrateError::unsupported_version(old_version))
}
}