MCPcopy Create free account
hub / github.com/ermak-dev/cloudpub / from

Method from

client/src/client.rs:59–74  ·  view source on GitHub ↗

Create a Client from `[client]` config block

(config: Arc<RwLock<ClientConfig>>, opts: ClientOpts)

Source from the content-addressed store, hash-verified

57impl<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(

Callers

nothing calls this directly

Calls 2

readMethod · 0.80
cloneMethod · 0.80

Tested by

no test coverage detected