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§
Sourcefn wire(
&mut self,
config: &OutboundLinkConfig,
address: &str,
) -> Result<Box<dyn Path>, OpenError>
fn wire( &mut self, config: &OutboundLinkConfig, address: &str, ) -> Result<Box<dyn Path>, OpenError>
§Errors
Carries the dialer’s own named refusal.
Sourcefn lookup(
&mut self,
config: &OutboundLinkConfig,
) -> Result<Vec<String>, OpenError>
fn lookup( &mut self, config: &OutboundLinkConfig, ) -> Result<Vec<String>, OpenError>
§Errors
The broker could not return the peer’s registered addresses.
Sourcefn punch(
&mut self,
config: &OutboundLinkConfig,
) -> Result<Box<dyn Path>, OpenError>
fn punch( &mut self, config: &OutboundLinkConfig, ) -> Result<Box<dyn Path>, OpenError>
§Errors
The direct KK link could not open.
Sourcefn relay(
&mut self,
config: &OutboundLinkConfig,
) -> Result<Box<dyn Path>, OpenError>
fn relay( &mut self, config: &OutboundLinkConfig, ) -> Result<Box<dyn Path>, OpenError>
§Errors
The relay or peer refused its endpoint-keyed link.
Provided Methods§
Sourcefn interrupt_handle(&self) -> Option<Stop>
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".