Skip to main content

samod_core/network/
transport_request.rs

1use url::Url;
2
3use super::DialerId;
4
5/// A request for the IO layer to establish a new transport for a dialer.
6///
7/// When a dialer needs a connection (either on initial registration or
8/// after a reconnection backoff expires), the hub emits a `DialRequest`.
9/// The IO layer should:
10///
11/// 1. Attempt to establish a transport to the given URL.
12/// 2. On success: call `HubEvent::create_dialer_connection(dialer_id)` to get
13///    a `ConnectionId`, wire up the stream/sink, then start driving the connection.
14/// 3. On failure: call `HubEvent::dial_failed(dialer_id, error)`.
15#[derive(Debug, Clone)]
16pub struct DialRequest {
17    /// The dialer that needs a transport.
18    pub dialer_id: DialerId,
19    /// The URL to connect to.
20    pub url: Url,
21}