Skip to content

Commit

Permalink
chore: export errors module
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Oct 13, 2024
1 parent be9c071 commit 21a8b78
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ All notable changes to mainline dht will be documented in this file.

### Added

- Export `PutError`
- Export `errors::PutError` as a part of the response of `Rpc::put`.

### Changed

- Removed all internal panic `#![deny(clippy::unwrap_used)]`
- Removed all internal panic `#![deny(clippy::unwrap_used)]`.
- `Testnet::new(size)` returns a `Result<Testnet>`.
- `Dht::local_addr()` returns a `Result<SocketAddr>`.
- `AsyncDht::local_addr()` returns a `Result<SocketAddr>`.
Expand All @@ -25,4 +25,4 @@ All notable changes to mainline dht will be documented in this file.

### Removed

- Removed `mainline::error::Error` and `mainline::error::Result`
- Removed `mainline::error::Error` and `mainline::error::Result`.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mainline"
version = "3.0.0"
version = "3.0.1"
authors = ["nuh.dev"]
edition = "2018"
description = "Simple, robust, BitTorrent's Mainline DHT implementation"
Expand All @@ -23,14 +23,17 @@ ed25519-dalek = "2.1.0"
bytes = "1.5.0"
tracing = "0.1"
lru = { version = "0.12.2", default-features = false }
document-features = "0.2.10"

[dev-dependencies]
clap = { version = "4.4.8", features = ["derive"] }
futures = "0.3.29"
tracing-subscriber = "0.3"

[features]
## Enable [Dht::as_async()] to use [async_dht::AsyncDht]
async = ["flume/async"]

default = []

[package.metadata.docs.rs]
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ It should work as a routing / storing node as well, and has been running in prod

Check the [Examples](https://github.com/Nuhvi/mainline/tree/main/examples).

## Features

### Client

Running as a client, means you can store and query for values on the DHT, but not accept any incoming requests.
Expand Down
2 changes: 1 addition & 1 deletion src/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
};

#[derive(Debug, Clone)]
/// Mainlin eDht node.
/// Mainline Dht node.
pub struct Dht(pub(crate) Sender<ActorMessage>);

pub struct Builder {
Expand Down
10 changes: 8 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#![doc = include_str!("../README.md")]
//! ## Feature flags
#![doc = document_features::document_features!()]
//!
// Public modules
mod common;

#[cfg(feature = "async")]
pub mod async_dht;
pub mod dht;
mod dht;
pub mod rpc;
pub mod server;

pub use crate::common::{Id, MutableItem};
pub use bytes::Bytes;
pub use dht::{Dht, Testnet};
pub use rpc::PutError;

pub use ed25519_dalek::SigningKey;

mod errors {
pub use super::rpc::PutError;
}

0 comments on commit 21a8b78

Please sign in to comment.