Struct bitcoin_tor::TorControlConnection
source · pub struct TorControlConnection { /* private fields */ }
Expand description
| Low-level handling for Tor control | connection. | | Speaks the SMTP-like protocol as defined | in torspec/control-spec.txt |
Implementations§
source§impl TorControlConnection
impl TorControlConnection
sourcepub fn new(base: *mut event_base) -> Self
pub fn new(base: *mut event_base) -> Self
| Create a new TorControlConnection. |
sourcepub fn readcb(&mut self, bev: *mut bufferevent, ctx: *mut c_void)
pub fn readcb(&mut self, bev: *mut bufferevent, ctx: *mut c_void)
| Libevent handlers: internal |
pub fn eventcb(&mut self, bev: *mut bufferevent, what: i16, ctx: *mut c_void)
sourcepub fn connect(
&mut self,
tor_control_center: &String,
connected: &ConnectionCB,
disconnected: &ConnectionCB
) -> bool
pub fn connect( &mut self, tor_control_center: &String, connected: &ConnectionCB, disconnected: &ConnectionCB ) -> bool
| Connect to a Tor control port. tor_control_center | is address of the form host:port. connected | is the handler that is called when connection | is successfully established. disconnected | is a handler that is called when the connection | is broken. | | Return true on success. |
sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
| Disconnect from Tor control port. |
sourcepub fn command(&mut self, cmd: &String, reply_handler: &ReplyHandlerCB) -> bool
pub fn command(&mut self, cmd: &String, reply_handler: &ReplyHandlerCB) -> bool
| Send a command, register a handler for | the reply. | | A trailing CRLF is automatically added. | | Return true on success. |
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for TorControlConnection
impl !Send for TorControlConnection
impl !Sync for TorControlConnection
impl Unpin for TorControlConnection
impl UnwindSafe for TorControlConnection
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more