use yog_core::BlockPos;
use yog_data::with::Raw;
use yog_data::{Diagnostic, Schema};
use yog_mirror::{MirrorSpec, Rate};
#[derive(Debug, Clone, Schema)]
pub struct Declare {
pub spec: MirrorSpec,
pub wanted: u64,
pub rate: Rate,
pub scope: Option<Scope>,
}
#[derive(Debug, Clone, PartialEq, Eq, Schema)]
pub struct Scope {
#[data(with = "Raw")]
pub bytes: Vec<u8>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Schema)]
pub struct BlockScope {
pub min: BlockPos,
pub max: BlockPos,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Schema)]
pub struct Place {
pub column: u64,
pub depth: u8,
}
#[derive(Debug, Clone, PartialEq, Eq, Schema)]
pub struct Declaration {
pub id: u32,
pub space: u64,
pub rows: u64,
pub fields: Vec<Option<Place>>,
}
#[derive(Debug, Clone, Schema)]
pub struct Declared {
pub declaration: Option<Declaration>,
pub problem: Option<Diagnostic>,
}
#[derive(Debug, Clone, Schema)]
pub struct Release {
pub id: u32,
}
#[derive(Debug, Clone, Schema)]
pub struct Provide {
pub spec: MirrorSpec,
pub host: bool,
pub family: bool,
}
#[derive(Debug, Clone, Schema)]
pub struct Touch {
pub name: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Schema)]
pub struct Key {
pub key: u64,
pub parent: Option<u64>,
}
#[derive(Debug, Clone, Schema)]
pub struct Keys {
pub space: String,
pub put: Vec<Key>,
pub take: Vec<u64>,
}
#[derive(Debug, Clone, Default, PartialEq, Eq, Schema)]
pub struct Write {
pub mirror: String,
pub fields: u64,
pub space: u64,
pub space_name: String,
pub rows: u64,
pub columns: Vec<u64>,
pub scopes: Vec<Scope>,
}