(path: P)
| 121 | |
| 122 | impl ClnRpc { |
| 123 | pub async fn new<P>(path: P) -> Result<ClnRpc> |
| 124 | where |
| 125 | P: AsRef<Path>, |
| 126 | { |
| 127 | debug!( |
| 128 | "Connecting to socket at {}", |
| 129 | path.as_ref().to_string_lossy() |
| 130 | ); |
| 131 | ClnRpc::from_stream(UnixStream::connect(path).await?) |
| 132 | } |
| 133 | |
| 134 | fn from_stream(stream: UnixStream) -> Result<ClnRpc> { |
| 135 | let (read, write) = stream.into_split(); |