[meta] Add more pub(crate) definitions.

This commit is contained in:
Benjamin Bouvier
2019-10-28 18:13:25 +01:00
parent 06b1817d89
commit 5889dd2c64
17 changed files with 86 additions and 93 deletions

View File

@@ -1,24 +1,24 @@
use std::iter;
#[derive(Clone, Copy, Hash, PartialEq, Eq)]
pub struct BoolSettingIndex(usize);
pub(crate) struct BoolSettingIndex(usize);
#[derive(Hash, PartialEq, Eq)]
pub struct BoolSetting {
pub(crate) struct BoolSetting {
pub default: bool,
pub bit_offset: u8,
pub predicate_number: u8,
}
#[derive(Hash, PartialEq, Eq)]
pub enum SpecificSetting {
pub(crate) enum SpecificSetting {
Bool(BoolSetting),
Enum(Vec<&'static str>),
Num(u8),
}
#[derive(Hash, PartialEq, Eq)]
pub struct Setting {
pub(crate) struct Setting {
pub name: &'static str,
pub comment: &'static str,
pub specific: SpecificSetting,
@@ -66,10 +66,10 @@ impl Setting {
}
#[derive(Hash, PartialEq, Eq)]
pub struct PresetIndex(usize);
pub(crate) struct PresetIndex(usize);
#[derive(Hash, PartialEq, Eq)]
pub enum PresetType {
pub(crate) enum PresetType {
BoolSetting(BoolSettingIndex),
OtherPreset(PresetIndex),
}
@@ -86,7 +86,7 @@ impl Into<PresetType> for PresetIndex {
}
#[derive(Hash, PartialEq, Eq)]
pub struct Preset {
pub(crate) struct Preset {
pub name: &'static str,
values: Vec<BoolSettingIndex>,
}
@@ -110,7 +110,7 @@ impl Preset {
}
}
pub struct SettingGroup {
pub(crate) struct SettingGroup {
pub name: &'static str,
pub settings: Vec<Setting>,
pub bool_start_byte_offset: u8,
@@ -160,7 +160,7 @@ impl SettingGroup {
/// This is the basic information needed to track the specific parts of a setting when building
/// them.
pub enum ProtoSpecificSetting {
pub(crate) enum ProtoSpecificSetting {
Bool(bool),
Enum(Vec<&'static str>),
Num(u8),
@@ -174,7 +174,7 @@ struct ProtoSetting {
}
#[derive(Hash, PartialEq, Eq)]
pub enum PredicateNode {
pub(crate) enum PredicateNode {
OwnedBool(BoolSettingIndex),
SharedBool(&'static str, &'static str),
Not(Box<PredicateNode>),
@@ -217,9 +217,9 @@ struct ProtoPredicate {
node: PredicateNode,
}
pub type SettingPredicateNumber = u8;
pub(crate) type SettingPredicateNumber = u8;
pub struct Predicate {
pub(crate) struct Predicate {
pub name: &'static str,
node: PredicateNode,
pub number: SettingPredicateNumber,
@@ -231,7 +231,7 @@ impl Predicate {
}
}
pub struct SettingGroupBuilder {
pub(crate) struct SettingGroupBuilder {
name: &'static str,
settings: Vec<ProtoSetting>,
presets: Vec<Preset>,