Skip to main content

MockableClientData

Trait MockableClientData 

Source
trait MockableClientData: Debug {
    type Conversation<'r>
       where Self: 'r;

    // Required methods
    fn m_start_conversation_last_hop<'life0, 'async_trait>(
        &'life0 self,
        msg: Option<AnyRelayMsg>,
        reply_handler: impl 'async_trait + MsgHandler + Send + 'static,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Conversation<'_>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn m_extend_virtual<'life0, 'life1, 'async_trait>(
        &'life0 self,
        protocol: RelayProtocol,
        role: HandshakeRole,
        handshake: impl 'async_trait + KeyGenerator + Send,
        params: CircParameters,
        capabilities: &'life1 Protocols,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn m_num_own_hops(&self) -> Result<usize>;
}
Expand description

Mock for onion service client data tunnel.

Required Associated Types§

Source

type Conversation<'r> where Self: 'r

Conversation

Required Methods§

Source

fn m_start_conversation_last_hop<'life0, 'async_trait>( &'life0 self, msg: Option<AnyRelayMsg>, reply_handler: impl 'async_trait + MsgHandler + Send + 'static, ) -> Pin<Box<dyn Future<Output = Result<Self::Conversation<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Converse

Source

fn m_extend_virtual<'life0, 'life1, 'async_trait>( &'life0 self, protocol: RelayProtocol, role: HandshakeRole, handshake: impl 'async_trait + KeyGenerator + Send, params: CircParameters, capabilities: &'life1 Protocols, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a virtual hop to the circuit.

Source

fn m_num_own_hops(&self) -> Result<usize>

Return the number of our own hops in this circuit.

This does not count any hops for the service’s rendezvous circuit. It does count our virtual hop, if we have one. (That isn’t a problem, since we only use this method to calculate timeouts, and we only calculate timeouts before we establish the virtual hop.)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MockableClientData for ClientOnionServiceDataTunnel

Source§

type Conversation<'r> = Conversation<'r>

Source§

fn m_start_conversation_last_hop<'life0, 'async_trait>( &'life0 self, msg: Option<AnyRelayMsg>, reply_handler: impl 'async_trait + MsgHandler + Send + 'static, ) -> Pin<Box<dyn Future<Output = Result<Self::Conversation<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn m_extend_virtual<'life0, 'life1, 'async_trait>( &'life0 self, protocol: RelayProtocol, role: HandshakeRole, handshake: impl 'async_trait + KeyGenerator + Send, params: CircParameters, capabilities: &'life1 Protocols, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn m_num_own_hops(&self) -> Result<usize>

Implementors§