pub struct TracerState {
pub nodes: RwLock<IndexMap<NodeId, Arc<NodeState>>>,
pub config: Arc<TracerConfig>,
}Expand description
State shared across all connections
Fields§
§nodes: RwLock<IndexMap<NodeId, Arc<NodeState>>>All currently-connected nodes, keyed by NodeId
config: Arc<TracerConfig>The loaded configuration
Implementations§
Source§impl TracerState
impl TracerState
Sourcepub fn new(config: Arc<TracerConfig>) -> Self
pub fn new(config: Arc<TracerConfig>) -> Self
Create a new empty tracer state
Sourcepub async fn register(&self, id: NodeId, name: String) -> Arc<NodeState>
pub async fn register(&self, id: NodeId, name: String) -> Arc<NodeState>
Register a node; returns the new NodeState.
name is the display name (from NodeInfo.niName). Pass the same
value as id when no name has been resolved yet.
Sourcepub async fn deregister(&self, id: &NodeId)
pub async fn deregister(&self, id: &NodeId)
Remove a node by ID
Auto Trait Implementations§
impl !Freeze for TracerState
impl !RefUnwindSafe for TracerState
impl Send for TracerState
impl Sync for TracerState
impl Unpin for TracerState
impl UnsafeUnpin for TracerState
impl !UnwindSafe for TracerState
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more