euv_core/component/impl.rs
1use crate::*;
2
3/// Implementation of ComponentContext construction.
4impl ComponentContext {
5 /// Creates a new empty component context.
6 pub fn new() -> Self {
7 let mut ctx: ComponentContext = ComponentContext::default();
8 ctx.set_hooks(Vec::new());
9 ctx.set_hook_index(0_usize);
10 ctx
11 }
12}
13
14/// Implementation of component context lifecycle and utility methods.
15impl ComponentContext {
16 /// Resets the hook index for a new render cycle.
17 pub fn reset_hook_index(&mut self) {
18 self.set_hook_index(0_usize);
19 }
20}