Skip to content

Commit

Permalink
chore: Change IpfsOptions visibility, remove UninitializedIpfs::{empt…
Browse files Browse the repository at this point in the history
…y, with_opt}
  • Loading branch information
dariusc93 committed Aug 26, 2024
1 parent 490ab28 commit ce03579
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
25 changes: 1 addition & 24 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -529,29 +529,6 @@ impl<C: NetworkBehaviour<ToSwarm = void::Void> + Send> UninitializedIpfs<C> {
}
}

/// 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![
Expand Down
2 changes: 1 addition & 1 deletion src/p2p/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ where
C: NetworkBehaviour,
<C as NetworkBehaviour>::ToSwarm: Debug + Send,
{
pub fn new(
pub(crate) fn new(
keypair: &Keypair,
options: &IpfsOptions,
repo: &Repo,
Expand Down
2 changes: 1 addition & 1 deletion src/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Default for SwarmConfig {
#[allow(deprecated)]
//TODO: use libp2p::SwarmBuilder
/// Creates a new IPFS swarm.
pub fn create_swarm<C>(
pub(crate) fn create_swarm<C>(
keypair: &Keypair,
options: &IpfsOptions,
repo: &Repo,
Expand Down

0 comments on commit ce03579

Please sign in to comment.