[][src]Struct tapir_cwtch::acns::tor::torrc::TorrcGenerator

pub struct TorrcGenerator { /* fields omitted */ }

Build a Torrc File with a set of configured options. Note: This is not a complete Torrc builder although it might one day grow to be one. As it stands it only allows the configuration options most necessary for Tor v3 Onion Service clients/servers as they related to Tapir/Cwtch. We use the Builder patter to allow easy programmatic construction for different Tor configurations.

Implementations

impl TorrcGenerator[src]

pub fn new() -> TorrcGenerator[src]

Generate a new, empty Torrc Generator.

pub fn with_socks_port(mut self: Self, socks_port: u16) -> Self[src]

Configure Tor to open a port to connect to external servers over Tor via SOCKS5

pub fn with_control_port(mut self: Self, control_port: u16) -> Self[src]

Configure Tor to have an open Control Port for configuration.

pub fn with_hashed_control_password(mut self: Self, password: &str) -> Self[src]

Force the tor control port to accept a hashed password as authentication, the given password is hashed with a random salt From the Tor Docs: If the 'HashedControlPassword' option is set, it must contain the salted hash of a secret password. The salted hash is computed according to the S2K algorithm in RFC 2440 (OpenPGP), and prefixed with the s2k specifier. This is then encoded in hexadecimal, prefixed by the indicator sequence "16:".

pub fn build(&self, file_name: &str) -> Result<(), ACNError>[src]

Compile the final torrc file and write it to the file system.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,