Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Change IpfsOptions visibility, remove UninitializedIpfs::{empty, with_opt} #294

Merged
merged 5 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
dariusc93 marked this conversation as resolved.
Show resolved Hide resolved

# 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