pub struct State<'a, T: ConfigState> {
pub path: Vec<String>,
pub stats: BTreeMap<Vec<String>, u32>,
pub config: T,
pub config_source: BTreeMap<String, Vec<String>>,
pub env: &'a TypeEnv,
/* private fields */
}Fields§
§path: Vec<String>§stats: BTreeMap<Vec<String>, u32>§config: T§config_source: BTreeMap<String, Vec<String>>§env: &'a TypeEnvImplementations§
Source§impl<'a, T: ConfigState> State<'a, T>
impl<'a, T: ConfigState> State<'a, T>
pub fn new(tree: &'a ConfigTree<T>, env: &'a TypeEnv) -> Self
Sourcepub fn with_scope(&mut self, scope: &Option<Scope<'_>>, idx: usize)
pub fn with_scope(&mut self, scope: &Option<Scope<'_>>, idx: usize)
Match paths in the scope first. If scope is None, clear the scope.
Sourcepub fn push_state(&mut self, elem: &StateElem<'_>) -> ConfigBackup<T>
pub fn push_state(&mut self, elem: &StateElem<'_>) -> ConfigBackup<T>
Update config based on the new elem in the path. Return the old state AFTER update_state.
pub fn pop_state(&mut self, old_config: ConfigBackup<T>, elem: StateElem<'_>)
pub fn update_stats(&mut self, key: &str)
pub fn report_unused(&self) -> Vec<String>
pub fn get_stats(self) -> BTreeMap<String, u32>
Auto Trait Implementations§
impl<'a, T> Freeze for State<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for State<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for State<'a, T>
impl<'a, T> !Sync for State<'a, T>
impl<'a, T> Unpin for State<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for State<'a, T>where
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more