pub struct SyncServer { /* private fields */ }Expand description
High-performance real-time sync server.
This server:
- Hosts a WebSocket server for client connections
- Watches the filesystem for changes
- Debounces file events to prevent thrashing
- Re-parses changed files and updates the graph
- Broadcasts updates to all connected clients
Implementations§
Source§impl SyncServer
impl SyncServer
Sourcepub fn new(config: SyncServerConfig) -> Self
pub fn new(config: SyncServerConfig) -> Self
Creates a new sync server.
Sourcepub fn with_graph(config: SyncServerConfig, graph: ArborGraph) -> Self
pub fn with_graph(config: SyncServerConfig, graph: ArborGraph) -> Self
Creates a sync server with an existing graph.
Creates a sync server with a shared graph.
Sourcepub fn graph(&self) -> SharedGraph
pub fn graph(&self) -> SharedGraph
Returns a handle to the shared graph.
Sourcepub fn subscribe(&self) -> Receiver<BroadcastMessage>
pub fn subscribe(&self) -> Receiver<BroadcastMessage>
Returns a broadcast receiver for server messages.
Sourcepub fn handle(&self) -> SyncServerHandle
pub fn handle(&self) -> SyncServerHandle
Returns a cloneable handle for triggering spotlight events.
Sourcepub async fn run(&self) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn run(&self) -> Result<(), Box<dyn Error + Send + Sync>>
Runs the server with file watching enabled.
Sourcepub fn focus_node(&self, node_id: &str, file: &str, line: u32)
pub fn focus_node(&self, node_id: &str, file: &str, line: u32)
Broadcasts a focus command to all clients.
Auto Trait Implementations§
impl Freeze for SyncServer
impl !RefUnwindSafe for SyncServer
impl Send for SyncServer
impl Sync for SyncServer
impl Unpin for SyncServer
impl UnsafeUnpin for SyncServer
impl !UnwindSafe for SyncServer
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