Create a Client from `[client]` config block
(config: Arc<RwLock<ClientConfig>>, opts: ClientOpts)
| 57 | impl<T: 'static + Transport> Client<T> { |
| 58 | // Create a Client from `[client]` config block |
| 59 | async fn from(config: Arc<RwLock<ClientConfig>>, opts: ClientOpts) -> Result<Client<T>> { |
| 60 | let transport = Arc::new( |
| 61 | T::new(&config.clone().read().transport) |
| 62 | .with_context(|| "Failed to create the transport")?, |
| 63 | ); |
| 64 | Ok(Client { |
| 65 | config, |
| 66 | opts, |
| 67 | services: Default::default(), |
| 68 | transport, |
| 69 | connected: false, |
| 70 | #[cfg(feature = "plugins")] |
| 71 | plugin_processes: Arc::new(DashMap::new()), |
| 72 | data_channels: Arc::new(DashMap::new()), |
| 73 | }) |
| 74 | } |
| 75 | |
| 76 | // The entrypoint of Client |
| 77 | async fn run( |