pub struct TorControlConnection { /* private fields */ }
Expand description
Control connection, used to send commands to and receive responses from the Tor server
Implementations§
Source§impl TorControlConnection
impl TorControlConnection
Sourcepub async fn connect<A: ToSocketAddrs>(addrs: A) -> Result<Self, TorError>
pub async fn connect<A: ToSocketAddrs>(addrs: A) -> Result<Self, TorError>
Connect to the Tor server. This is generally how you create a connection to the server
Sourcepub async fn get_protocol_info(&mut self) -> Result<ProtocolInfo, TorError>
pub async fn get_protocol_info(&mut self) -> Result<ProtocolInfo, TorError>
Send the PROTOCOLINFO command and parse the response
Sourcepub async fn get_info(&mut self, info: &str) -> Result<Vec<String>, TorError>
pub async fn get_info(&mut self, info: &str) -> Result<Vec<String>, TorError>
Send the GETINFO command and parse the response
Sourcepub async fn authenticate(
&mut self,
method: TorAuthentication,
) -> Result<(), TorError>
pub async fn authenticate( &mut self, method: TorAuthentication, ) -> Result<(), TorError>
Authenticate to the Tor server using the passed-in method
Sourcepub async fn create_onion_service(
&mut self,
ports: &[OnionServiceMapping],
transient: bool,
signing_key: Option<&TorEd25519SigningKey>,
) -> Result<OnionService, TorError>
pub async fn create_onion_service( &mut self, ports: &[OnionServiceMapping], transient: bool, signing_key: Option<&TorEd25519SigningKey>, ) -> Result<OnionService, TorError>
Create an onion service.
pub async fn delete_onion_service( &mut self, service_id: &str, ) -> Result<(), TorError>
Auto Trait Implementations§
impl Freeze for TorControlConnection
impl RefUnwindSafe for TorControlConnection
impl Send for TorControlConnection
impl Sync for TorControlConnection
impl Unpin for TorControlConnection
impl UnwindSafe for TorControlConnection
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