refactor(v2): extract bterminal-core crate with EventSink trait
Create Cargo workspace at v2/ level with members: src-tauri, bterminal-core, bterminal-relay. Extract PtyManager and SidecarManager into shared bterminal-core crate with EventSink trait for abstracting event emission. TauriEventSink wraps AppHandle. src-tauri pty.rs and sidecar.rs become thin re-exports. Move Cargo.lock to workspace root. Add v2/target/ to .gitignore.
This commit is contained in:
parent
250ea17d3e
commit
f894c2862c
13 changed files with 972 additions and 453 deletions
11
v2/src-tauri/src/event_sink.rs
Normal file
11
v2/src-tauri/src/event_sink.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use bterminal_core::event::EventSink;
|
||||
use tauri::{AppHandle, Emitter};
|
||||
|
||||
/// Bridges bterminal-core's EventSink trait to Tauri's event system.
|
||||
pub struct TauriEventSink(pub AppHandle);
|
||||
|
||||
impl EventSink for TauriEventSink {
|
||||
fn emit(&self, event: &str, payload: serde_json::Value) {
|
||||
let _ = self.0.emit(event, &payload);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue