diff options
author | Ferris Tseng <ferristseng@fastmail.fm> | 2021-02-23 23:25:19 -0500 |
---|---|---|
committer | Ferris Tseng <ferristseng@fastmail.fm> | 2021-02-23 23:25:19 -0500 |
commit | 2263944af0da6b0b837285af78dafad765853853 (patch) | |
tree | be35f42eb7695f5544cc787e56dc30b08e6adec7 | |
parent | 9c627dbfa062feb4da257810c291d69e619179a8 (diff) |
add documentation
-rw-r--r-- | ipfs-api-backend-actix/src/backend.rs | 3 | ||||
-rw-r--r-- | ipfs-api-backend-hyper/src/backend.rs | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ipfs-api-backend-actix/src/backend.rs b/ipfs-api-backend-actix/src/backend.rs index 21da5c9..73fdf0b 100644 --- a/ipfs-api-backend-actix/src/backend.rs +++ b/ipfs-api-backend-actix/src/backend.rs @@ -21,6 +21,9 @@ pub struct ActixBackend { } impl Default for ActixBackend { + /// Creates an `IpfsClient` connected to the endpoint specified in ~/.ipfs/api. + /// If not found, tries to connect to `localhost:5001`. + /// fn default() -> Self { Self::from_ipfs_config() .unwrap_or_else(|| Self::from_host_and_port(Scheme::HTTP, "localhost", 5001).unwrap()) diff --git a/ipfs-api-backend-hyper/src/backend.rs b/ipfs-api-backend-hyper/src/backend.rs index a23bbd3..0798fc9 100644 --- a/ipfs-api-backend-hyper/src/backend.rs +++ b/ipfs-api-backend-hyper/src/backend.rs @@ -22,6 +22,9 @@ pub struct HyperBackend { } impl Default for HyperBackend { + /// Creates an `IpfsClient` connected to the endpoint specified in ~/.ipfs/api. + /// If not found, tries to connect to `localhost:5001`. + /// fn default() -> Self { Self::from_ipfs_config() .unwrap_or_else(|| Self::from_host_and_port(Scheme::HTTP, "localhost", 5001).unwrap()) |