Crate tor_events

Source
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 and TorEventKind types.

Structs§

EventReactor
A reactor used to forward events to make the event reporting system work.
TorEventReceiver
A receiver for TorEvents emitted by other users of this crate.

Enums§

ReceiverError
An error encountered when trying to receive a TorEvent.

Constants§

EVENT_KIND_COUNT 🔒
The number of TorEventKinds 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 the EventReactor.
EVENT_SUBSCRIBERS 🔒
An array containing one AtomicUsize for each TorEventKind, 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, whether TorEventReceiver::subscribe has been called with that event kind).