MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / observer_state_mut

Method observer_state_mut

nodedb-raft/src/state.rs:220–225  ·  view source on GitHub ↗

Get a mutable reference to an observer's state.

(&mut self, observer: u64)

Source from the content-addressed store, hash-verified

218
219 /// Get a mutable reference to an observer's state.
220 pub fn observer_state_mut(&mut self, observer: u64) -> Option<&mut ObserverState> {
221 self.observer_states
222 .iter_mut()
223 .find(|(id, _)| *id == observer)
224 .map(|(_, state)| state)
225 }
226
227 /// Whether an observer's send queue is below the backpressure threshold.
228 /// Returns `false` if the observer is unknown.

Calls 2

iter_mutMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected