Skip to content

Commit

Permalink
Generate README.md using cargo rdme
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed Jul 28, 2024
1 parent 0e5b19a commit 62992ed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ version = "0.1.0"
edition = "2021"
description = "A library for working with BIP329 labels"
license = "Apache-2.0"

repository = "https://github.com/bitcoinppl/bip329"
keywords = ["bitcoin", "bip329", "labels"]
categories = ["bitcoin"]
homepage = "https://github.com/bitcoinppl/bip329"
repository = "https://github.com/bitcoinppl/bip329"
documentation = "https://docs.rs/bip329"

[features]
default = ["encryption"]
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# bip329

<!-- cargo-rdme start -->

A library for working with [BIP329 labels](https://github.com/bitcoin/bips/blob/master/bip-00329.mediawiki).

This library provides a way to work with BIP329 labels in a Rust program.

The main data structure is the [`Labels`] struct, which is a list of `Label` structs.
The main data structure is the [`Labels`](https://docs.rs/bip329/latest/bip329/struct.Labels.html) struct, which is a list of [`Label`](https://docs.rs/bip329/latest/bip329/enum.Label.html) structs.

The [`Label`] enum is a discriminated union of all the different types of labels.
The [`Label`](https://docs.rs/bip329/latest/bip329/enum.Label.html) enum is a discriminated union of all the different types of labels.

The [`Labels`] struct can be exported to a JSONL file.
The [`Labels`](https://docs.rs/bip329/latest/bip329/struct.Labels.html) struct can be exported to a JSONL file.

The [`Labels`] struct can be imported from a JSONL file.
The `Labels` struct can be imported from a JSONL file.

#### Example Import:
```rust
Expand All @@ -30,7 +32,7 @@ let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap();
let jsonl = labels.export().unwrap();
```

You can encrypt and decrypt the [`Labels`] into/from the [`encryption::EncryptedLabels`] struct using the `encryption` feature.
You can encrypt and decrypt the `Labels` into/from the [`encryption::EncryptedLabels`](https://docs.rs/bip329/latest/bip329/encryption/struct.EncryptedLabels.html) struct using the `encryption` feature.

#### Example encryption:
```rust
Expand All @@ -41,5 +43,4 @@ let encrypted = EncryptedLabels::encrypt(&labels, "passphrase").unwrap();
let decrypted: Labels = encrypted.decrypt("passphrase").unwrap();
```


License: Apache-2.0
<!-- cargo-rdme end -->
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
//!
//! This library provides a way to work with BIP329 labels in a Rust program.
//!
//! The main data structure is the [`Labels`] struct, which is a list of `Label` structs.
//! The main data structure is the [`Labels`](crate::Labels) struct, which is a list of [`Label`](crate::Label) structs.
//!
//! The [`Label`] enum is a discriminated union of all the different types of labels.
//! The [`Label`](crate::Label) enum is a discriminated union of all the different types of labels.
//!
//! The [`Labels`] struct can be exported to a JSONL file.
//! The [`Labels`](crate::Labels) struct can be exported to a JSONL file.
//!
//! The [`Labels`] struct can be imported from a JSONL file.
//! The `Labels` struct can be imported from a JSONL file.
//!
//! ### Example Import:
//! ```rust
Expand All @@ -28,7 +28,7 @@
//! let jsonl = labels.export().unwrap();
//! ```
//!
//! You can encrypt and decrypt the [`Labels`] into/from the [`encryption::EncryptedLabels`] struct using the `encryption` feature.
//! You can encrypt and decrypt the `Labels` into/from the [`encryption::EncryptedLabels`](crate::encryption::EncryptedLabels) struct using the `encryption` feature.
//!
//! ### Example encryption:
//! ```rust
Expand Down

0 comments on commit 62992ed

Please sign in to comment.