aboutsummaryrefslogtreecommitdiff
path: root/niri-ipc/src/state.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-09-04 12:21:23 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-09-04 12:29:26 +0300
commit6c4e4b374a48a5d3d46a7b7e9fded128232ccfbe (patch)
tree7139e2a985e8e2482fbadddc9e775a56f692a0e2 /niri-ipc/src/state.rs
parent9ab887bec891db61b7f97428dc803f417ed9640a (diff)
downloadniri-6c4e4b374a48a5d3d46a7b7e9fded128232ccfbe.tar.gz
niri-6c4e4b374a48a5d3d46a7b7e9fded128232ccfbe.tar.bz2
niri-6c4e4b374a48a5d3d46a7b7e9fded128232ccfbe.zip
ipc: Write some more docs
Diffstat (limited to 'niri-ipc/src/state.rs')
-rw-r--r--niri-ipc/src/state.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/niri-ipc/src/state.rs b/niri-ipc/src/state.rs
index 8d2d1744..2ab58fc3 100644
--- a/niri-ipc/src/state.rs
+++ b/niri-ipc/src/state.rs
@@ -1,4 +1,10 @@
//! Helpers for keeping track of the event stream state.
+//!
+//! 1. Create an [`EventStreamState`] using `Default::default()`, or any individual state part if
+//! you only care about part of the state.
+//! 2. Connect to the niri socket and request an event stream.
+//! 3. Pass every [`Event`] to [`EventStreamStatePart::apply`] on your state.
+//! 4. Read the fields of the state as needed.
use std::collections::hash_map::Entry;
use std::collections::HashMap;