Signal

Enum Signal 

Source
pub enum Signal {
Show 15 variants Reload, Hup, Shutdown, Int, Dump, Usr1, Debug, Usr2, Halt, Term, Newnym, ClearDnsCache, Heartbeat, Active, Dormant,
}
Expand description

Signals that can be sent to the Tor process.

These signals control Tor’s behavior and can be sent via controller::Controller::signal.

§Signal Pairs

Some signals have Unix signal equivalents:

§Example

use stem_rs::{controller::Controller, Signal};

// Request new circuits for privacy
controller.signal(Signal::Newnym).await?;

// Clear DNS cache
controller.signal(Signal::ClearDnsCache).await?;

Variants§

§

Reload

Reload configuration files.

Tor will reload torrc and apply changes that can be changed at runtime. Equivalent to sending SIGHUP.

§

Hup

Alias for Reload.

Unix SIGHUP signal equivalent.

§

Shutdown

Controlled shutdown.

Tor will close listeners and exit cleanly after current connections complete, waiting ShutdownWaitLength if configured as a relay.

§

Int

Alias for Shutdown.

Unix SIGINT signal equivalent.

§

Dump

Dump information about open connections and circuits to the log.

Useful for debugging connection issues.

§

Usr1

Alias for Dump.

Unix SIGUSR1 signal equivalent.

§

Debug

Switch logging to DEBUG level.

Temporarily enables debug-level logging until the next RELOAD.

§

Usr2

Alias for Debug.

Unix SIGUSR2 signal equivalent.

§

Halt

Immediate shutdown.

Tor exits immediately without waiting for connections to close.

§

Term

Alias for Halt.

Unix SIGTERM signal equivalent.

§

Newnym

Request new circuits for future connections.

Clears the current circuit cache and builds new circuits. Also clears the DNS cache. Rate-limited to prevent abuse. Use this for privacy when you want to appear as a “new” user.

§

ClearDnsCache

Clear cached DNS results.

Forces Tor to re-resolve all hostnames on subsequent requests.

§

Heartbeat

Trigger a heartbeat log message.

Useful for monitoring that Tor is responsive.

§

Active

Wake from dormant mode.

Resumes normal operation if Tor was in dormant mode. Disables dormant mode.

§

Dormant

Enter dormant mode.

Reduces resource usage (CPU and network) when Tor is not actively needed. Tor will avoid building circuits and making network connections.

Trait Implementations§

Source§

impl Clone for Signal

Source§

fn clone(&self) -> Signal

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Signal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Signal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Signal

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Signal

Source§

fn eq(&self, other: &Signal) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Signal

Source§

impl Eq for Signal

Source§

impl StructuralPartialEq for Signal

Auto Trait Implementations§

§

impl Freeze for Signal

§

impl RefUnwindSafe for Signal

§

impl Send for Signal

§

impl Sync for Signal

§

impl Unpin for Signal

§

impl UnwindSafe for Signal

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.