Expand description
§tor-events
Tools for generating a stream of structured events, similar to C tor’s ControlPort
.
License: MIT OR Apache-2.0
Modules§
- events
- The
TorEvent
andTorEventKind
types.
Structs§
- Event
Reactor - A reactor used to forward events to make the event reporting system work.
- TorEvent
Receiver - A receiver for
TorEvent
s emitted by other users of this crate.
Enums§
- Receiver
Error - An error encountered when trying to receive a
TorEvent
.
Constants§
- EVENT_
KIND_ 🔒COUNT - The number of
TorEventKind
s there are.
Statics§
- BROADCAST_
CAPACITY - The size of the internal broadcast channel used to implement event subscription.
- CURRENT_
RECEIVER 🔒 - An inactive receiver for the currently active broadcast channel, if there is one.
- EVENT_
SENDER 🔒 - Pointer to an
UnboundedSender
, used to send events into theEventReactor
. - EVENT_
SUBSCRIBERS 🔒 - An array containing one
AtomicUsize
for eachTorEventKind
, used to track subscriptions.
Functions§
- broadcast
- Broadcast the given
TorEvent
to any interested subscribers. - event_
has_ subscribers - Returns a boolean indicating whether the event
kind
has any subscribers (as in, whetherTorEventReceiver::subscribe
has been called with that event kind).