Refactored component

This commit is contained in:
2026-01-30 23:36:54 +01:00
parent 4e2d4662d1
commit eefa41318c
9 changed files with 84 additions and 75 deletions
+2 -5
View File
@@ -2,11 +2,8 @@ use std::{io::stdout, sync::Arc, time::Instant};
use crossterm::{cursor::MoveTo, execute, terminal::Clear};
use crate::{
prelude::{ComponentImpl, Context},
render::Area,
DrawContext, View,
};
use crate::component::{context::Context, ComponentImpl};
use crate::{render::Area, DrawContext, View};
use super::Engine;
+1 -1
View File
@@ -5,9 +5,9 @@ use std::{
use crossterm::{cursor::MoveTo, execute, terminal::Clear};
use crate::component::{context::Context, ComponentImpl};
use crate::{
engine::{commands, CommandExecutor},
prelude::{ComponentImpl, Context},
render::Area,
DrawContext, View,
};
+2 -5
View File
@@ -7,11 +7,8 @@ pub use console::*;
use std::{any::Any, sync::Arc};
use crate::{
prelude::{ComponentImpl, Context},
render::Area,
DrawContext, View,
};
use crate::component::{context::Context, ComponentImpl};
use crate::{render::Area, DrawContext, View};
pub trait Engine<Output = ()> {
fn run<C: ComponentImpl + 'static>(&self, component: C) -> crate::Result<Output>;