Skip to main content

Backend

Trait Backend 

Source
pub trait Backend: Send + Debug {
    // Required methods
    fn wire(
        &mut self,
        config: &OutboundLinkConfig,
        address: &str,
    ) -> Result<Box<dyn Path>, OpenError>;
    fn lookup(
        &mut self,
        config: &OutboundLinkConfig,
    ) -> Result<Vec<String>, OpenError>;
    fn punch(
        &mut self,
        config: &OutboundLinkConfig,
    ) -> Result<Box<dyn Path>, OpenError>;
    fn relay(
        &mut self,
        config: &OutboundLinkConfig,
    ) -> Result<Box<dyn Path>, OpenError>;
    fn repunch(
        &mut self,
        config: &OutboundLinkConfig,
        path: &mut dyn Path,
    ) -> Result<(), OpenError>;
    fn topology(
        &mut self,
        carrier: Option<Carrier>,
        relay: Option<String>,
        refusal: Option<&str>,
    ) -> Result<(), OpenError>;

    // Provided method
    fn interrupt_handle(&self) -> Option<Stop> { ... }
}
Expand description

The existing dial, broker, punch, and relay implementations meet here.

Required Methods§

Source

fn wire( &mut self, config: &OutboundLinkConfig, address: &str, ) -> Result<Box<dyn Path>, OpenError>

§Errors

Carries the dialer’s own named refusal.

Source

fn lookup( &mut self, config: &OutboundLinkConfig, ) -> Result<Vec<String>, OpenError>

§Errors

The broker could not return the peer’s registered addresses.

Source

fn punch( &mut self, config: &OutboundLinkConfig, ) -> Result<Box<dyn Path>, OpenError>

§Errors

The direct KK link could not open.

Source

fn relay( &mut self, config: &OutboundLinkConfig, ) -> Result<Box<dyn Path>, OpenError>

§Errors

The relay or peer refused its endpoint-keyed link.

Source

fn repunch( &mut self, config: &OutboundLinkConfig, path: &mut dyn Path, ) -> Result<(), OpenError>

Refreshes the mapping while retaining this packet’s transport and counter.

§Errors

The broker or peer could not refresh the direct endpoint.

Source

fn topology( &mut self, carrier: Option<Carrier>, relay: Option<String>, refusal: Option<&str>, ) -> Result<(), OpenError>

§Errors

The topology consumer could not record the observed fact.

Provided Methods§

Source

fn interrupt_handle(&self) -> Option<Stop>

Interrupts the backend’s owned blocking operations during shutdown.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§