Skip to content

Commit 00ead79

Browse files
Merge pull request #3 from sebastienrousseau/feat/rssgen
v0.0.2
2 parents ed11bf7 + 3d7bc7d commit 00ead79

File tree

14 files changed

+1859
-263
lines changed

14 files changed

+1859
-263
lines changed

Cargo.toml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[package]
66
# General project metadata
77
name = "rss-gen" # The name of the library
8-
version = "0.0.1" # Initial version of the crate
8+
version = "0.0.2" # Initial version of the crate
99
authors = ["RSS Generator Contributors"] # Library contributors
1010
edition = "2021" # Rust edition being used
1111
rust-version = "1.56.0" # Minimum supported Rust version
@@ -23,17 +23,6 @@ build = "build.rs" # Path to the build script
2323
# Crate Configuration
2424
# -----------------------------------------------------------------------------
2525

26-
[[bench]]
27-
# [[bench]] sections define benchmarks.
28-
name = "benchmark"
29-
harness = false
30-
path = "benches/criterion.rs"
31-
32-
[profile.bench]
33-
# Profile for benchmarks.
34-
debug = true
35-
36-
3726
# Crates.io categories
3827
categories = [
3928
"data-formats", # For handling RSS and XML formats
@@ -62,7 +51,7 @@ exclude = [
6251
# List of external crates used in this project
6352
dtt = "0.0"
6453
log = "0.4"
65-
quick-xml = "0.36"
54+
quick-xml = { version = "0.36", features = ["serialize"] }
6655
serde = { version = "1.0", features = ["derive"] }
6756
serde_json = "1.0"
6857
thiserror = "1.0"
@@ -86,3 +75,19 @@ lazy_static = "1.5"
8675
# Library-specific settings
8776
name = "rss_gen" # Internal name of the library
8877
path = "src/lib.rs" # Path to the library entry point
78+
79+
# -----------------------------------------------------------------------------
80+
# Benchmarking
81+
# -----------------------------------------------------------------------------
82+
83+
[[bench]]
84+
# [[bench]] sections define benchmarks.
85+
name = "benchmark"
86+
harness = false
87+
path = "benches/criterion.rs"
88+
89+
[profile.bench]
90+
# Profile for benchmarks.
91+
debug = true
92+
93+

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ A comprehensive Rust library for generating, parsing, serializing, and deseriali
3131
- Serialization and deserialization of RSS data
3232
- Extensible elements for managing standard and optional RSS fields
3333
- Atom link support for modern syndication compatibility
34-
- Image embedding for RSS 2.0 feeds
34+
- Image embedding for RSS feeds
3535
- Comprehensive error handling and validation
36-
- Performance-optimized XML processing
36+
- Performance-optimized XML processing using quick-xml
37+
- Convenient macros for RSS generation and data manipulation
3738

3839
## Installation
3940

4041
Add this to your `Cargo.toml`:
4142

4243
```toml
4344
[dependencies]
44-
rss-gen = "0.0.1"
45+
rss-gen = "0.0.2"
4546
```
4647

4748
## Usage
@@ -108,6 +109,34 @@ Refer to the [documentation][09] for more details on how to use these macros.
108109

109110
For full API documentation, please visit [docs.rs/rss-gen][09].
110111

112+
## Examples
113+
114+
The library comes with several examples demonstrating various features:
115+
116+
- `example_data.rs`: Shows how to create and manipulate RSS data structures.
117+
- `example_error.rs`: Demonstrates error handling in RSS Gen.
118+
- `example_generator.rs`: Illustrates RSS feed generation for different RSS versions.
119+
- `example_lib.rs`: Provides general usage examples of the library.
120+
- `example_macros.rs`: Shows how to use the provided macros.
121+
- `example_parser.rs`: Demonstrates parsing RSS feeds from XML content.
122+
- `example_validator.rs`: Illustrates the usage of the RSS feed validator.
123+
124+
To run an example, use the following command:
125+
126+
```shell
127+
cargo run --example example_name
128+
```
129+
130+
Replace `example_name` with the name of the example you want to run (e.g., `example_generator`).
131+
132+
## Benchmarks
133+
134+
The library includes benchmarks to measure performance. You can run them using:
135+
136+
```shell
137+
cargo bench
138+
```
139+
111140
## Supported RSS Versions
112141

113142
- RSS 0.90
@@ -158,7 +187,7 @@ This crate wouldn't be possible without the valuable open-source work of others,
158187
[14]: https://www.rust-lang.org "The Rust Programming Language"
159188
[16]: https://github.com/sebastienrousseau/rssgen/actions?query=branch%3Amain "Build Status"
160189

161-
[build-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/rss-gen/release.yml?branch=main&style=for-the-badge&logo=github "Build Status"
190+
[build-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/rssgen/release.yml?branch=main&style=for-the-badge&logo=github "Build Status"
162191
[crates-badge]: https://img.shields.io/crates/v/rss-gen.svg?style=for-the-badge 'Crates.io badge'
163192
[docs-badge]: https://img.shields.io/docsrs/rss-gen.svg?style=for-the-badge 'Docs.rs badge'
164193
[libs-badge]: https://img.shields.io/badge/lib.rs-v0.1.0-orange.svg?style=for-the-badge 'Lib.rs badge'

examples/example.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright © 2024 RSS Gen. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
//! # RSS Gen (rss-gen)
4+
//! # RSS Gen (rss-gen) Examples
55
//!
6-
//! This file serves as an entry point for running all the RSS Gen (rss-gen) examples, demonstrating logging levels, formats, macros, and library functionality.
7-
8-
#![allow(missing_docs)]
6+
//! This module serves as an entry point for running all the RSS Gen (rss-gen) examples,
7+
//! demonstrating various aspects of the library including logging levels, formats,
8+
//! macros, and core functionality.
99
1010
mod example_data;
1111
mod example_error;
@@ -15,20 +15,24 @@ mod example_macros;
1515
mod example_parser;
1616
mod example_validator;
1717

18-
/// Entry point to run all RSS Gen examples.
18+
use std::error::Error;
19+
20+
/// Runs all RSS Gen examples.
1921
///
20-
/// This function calls all the individual examples for log levels, log formats, macros, and library functionality.
21-
fn main() {
22+
/// This function sequentially executes all individual examples, demonstrating
23+
/// various features and capabilities of the RSS Gen library.
24+
fn main() -> Result<(), Box<dyn Error>> {
2225
println!("\n🦀 Running RSS Gen (rss-gen) Examples 🦀");
2326

24-
// Run the example modules.
25-
let _ = example_data::main();
26-
let _ = example_error::main();
27-
example_generator::main();
28-
example_lib::main();
29-
let _ = example_macros::main();
30-
example_parser::main();
31-
example_validator::main();
27+
// Run the example modules
28+
example_data::main()?;
29+
example_error::main()?;
30+
example_generator::main()?;
31+
example_lib::main()?;
32+
example_macros::main()?;
33+
example_parser::main()?;
34+
example_validator::main()?;
3235

33-
println!("\n🎉 All RustLogs examples completed successfully!\n");
36+
println!("\n🎉 All RSS Gen examples completed successfully!\n");
37+
Ok(())
3438
}

0 commit comments

Comments
 (0)