diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e1fb015..306a741e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - refactor: Reference `Block` in `BlockStore::put_block`. [PR 272](https://github.com/dariusc93/rust-ipfs/pull/272) - feat: Passthrough timeout to WantSession::new. [PR 265](https://github.com/dariusc93/rust-ipfs/pull/265) - chore: Update libp2p to 0.54. [PR 289](https://github.com/dariusc93/rust-ipfs/pull/289) +- chore: Change IpfsOptions visibility, remove UninitializedIpfs::{empty, with_opt}.[PR XXX](https://github.com/dariusc93/rust-ipfs/pull/XXX) # 0.11.21 - chore: Put libp2p-webrtc-websys behind feature. diff --git a/src/lib.rs b/src/lib.rs index 8ffec823d..e847dafee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,7 +172,7 @@ impl PartialEq for StorageType { impl Eq for StorageType {} /// Ipfs node options used to configure the node to be created with [`UninitializedIpfs`]. -pub struct IpfsOptions { +struct IpfsOptions { /// The path of the ipfs repo (blockstore and datastore). /// /// This is always required but can be any path with in-memory backends. The filesystem backend @@ -529,29 +529,6 @@ impl + Send> UninitializedIpfs { } } - /// New uninitualized instance without any listener addresses - #[deprecated( - note = "UninitializedIpfs::empty will be removed in the future. Use UninitializedIpfs::new()" - )] - pub fn empty() -> Self { - Self::new() - } - - /// Configures a new UninitializedIpfs with from the given options and optionally a span. - /// If the span is not given, it is defaulted to `tracing::trace_span!("ipfs")`. - /// - /// The span is attached to all operations called on the later created `Ipfs` along with all - /// operations done in the background task as well as tasks spawned by the underlying - /// `libp2p::Swarm`. - #[deprecated( - note = "UninitializedIpfs::with_opt will be removed in the future. Use UninitializedIpfs::new()" - )] - pub fn with_opt(options: IpfsOptions) -> Self { - let mut opt = Self::new(); - opt.options = options; - opt - } - /// Set default listening unspecified ipv4 and ipv6 addresseses for tcp and udp/quic pub fn set_default_listener(self) -> Self { self.add_listening_addrs(vec![ diff --git a/src/p2p/behaviour.rs b/src/p2p/behaviour.rs index cb191c0f1..f703d5edb 100644 --- a/src/p2p/behaviour.rs +++ b/src/p2p/behaviour.rs @@ -354,7 +354,7 @@ where C: NetworkBehaviour, ::ToSwarm: Debug + Send, { - pub fn new( + pub(crate) fn new( keypair: &Keypair, options: &IpfsOptions, repo: &Repo, diff --git a/src/p2p/mod.rs b/src/p2p/mod.rs index d6adeb7bc..763f7c3cd 100644 --- a/src/p2p/mod.rs +++ b/src/p2p/mod.rs @@ -178,7 +178,7 @@ impl Default for SwarmConfig { #[allow(deprecated)] //TODO: use libp2p::SwarmBuilder /// Creates a new IPFS swarm. -pub fn create_swarm( +pub(crate) fn create_swarm( keypair: &Keypair, options: &IpfsOptions, repo: &Repo,