File: README.md

package info (click to toggle)
rust-debbugs 0.1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 320 kB
  • sloc: makefile: 4
file content (116 lines) | stat: -rw-r--r-- 3,088 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# debbugs-rs

A Rust client library for the [Debian Bug Tracking System (Debbugs)](https://wiki.debian.org/DebbugsSoapInterface).

This crate provides a simple wrapper around the SOAP API for the Debian bug tracking system, allowing you to query bug reports, search for bugs, and retrieve detailed information programmatically.

## Features

- **Async and blocking interfaces**: Choose between `debbugs::Debbugs` (async) and `debbugs::blocking::Debbugs` (blocking)
- **Comprehensive bug data**: Access bug reports, logs, and metadata
- **Search functionality**: Search bugs by package, status, severity, and more
- **Mail parsing**: Optional mail parsing support with the `mailparse` feature

## Installation

Add this to your `Cargo.toml`:

```toml
[dependencies]
debbugs = "0.1"
```

### Feature Flags

- `blocking` (default): Enables the blocking client interface
- `tokio` (default): Enables the async client interface
- `mailparse` (default): Enables parsing of email messages in bug logs

## Usage

### Async Interface

```rust
use debbugs::Debbugs;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Debbugs::default();
    
    // Get the 10 newest bugs
    let bugs = client.newest_bugs(10).await?;
    println!("Latest bugs: {:?}", bugs);
    
    // Get detailed status for specific bugs
    let reports = client.get_status(&[12345, 67890]).await?;
    for report in reports {
        println!("Bug #{}: {}", report.bugnumber, report.subject);
    }
    
    // Search for bugs in a specific package
    let search = debbugs::SearchQuery {
        package: Some("rust-debbugs".to_string()),
        ..Default::default()
    };
    let found_bugs = client.get_bugs(search).await?;
    println!("Found {} bugs in package", found_bugs.len());
    
    Ok(())
}
```

### Blocking Interface

```rust
use debbugs::blocking::Debbugs;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Debbugs::default();
    
    // Get the 10 newest bugs
    let bugs = client.newest_bugs(10)?;
    println!("Latest bugs: {:?}", bugs);
    
    // Get bug logs with messages
    let logs = client.get_bug_log(12345)?;
    for log in logs {
        println!("Message: {}", log.header);
    }
    
    Ok(())
}
```

### Custom Server

```rust
use debbugs::Debbugs;

let client = Debbugs::new("https://custom-debbugs.example.com/soap.cgi");
```

## Examples

The repository includes several examples in the `examples/` directory:

- `newest.rs` - Fetch the newest bugs
- `get_status.rs` - Get detailed status for specific bugs
- `get_bugs.rs` - Search for bugs matching criteria
- `get_bug_log.rs` - Retrieve bug logs and messages
- `wnpp_bugs.rs` - Find Work-Needing and Prospective Packages (WNPP) bugs
- `all.rs` - Fetch all bugs (use with caution!)

Run an example with:

```bash
cargo run --example newest --features tokio
```

## Documentation

- [API Documentation](https://docs.rs/debbugs)
- [Debian Debbugs SOAP Interface](https://wiki.debian.org/DebbugsSoapInterface)

## License

Licensed under the Apache License, Version 2.0.