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
/*
# msuc-rs
This crate provides a client interface for the [Microsoft Update Catalog](https://www.catalog.update.microsoft.com/Home.aspx). It supports searching
the catalog and retrieve the details for specific updates.
## Usage
This crate is [on crates.io](https://crates.io/crates/msuc) and can be
used by adding `msuc` to your dependencies in your project's `Cargo.toml`.
```toml
[dependencies]
msuc = "1.0.0"
```
## Examples
### Searching the Update Catalog
```rust
use msuc::prelude::*;
#[tokio::main]
async fn main() {
let client = MsucClient::new();
let search = client.search("MS08-067");
loop {
match search.next().await {
Ok(Some(results)) => {
for r in results {
println!("title: {}", r.title);
println!("id: {}", r.id);
println!("kb: {}", r.kb);
println!("product: {}", r.product);
println!("classification: {}", r.classification);
println!("last modified: {}", r.last_modified);
println!("version: {}", r.version.unwrap_or("".to_string()));
println!("size: {}", r.size);
println!();
}
},
Ok(None) => break,
Err(e) => println!("error: {}", e),
}
}
}
```
### Retrieving the Details for an Update
```rust
use msuc::prelude::*;
#[tokio::main]
async fn main() {
let client = MsucClient::new();
// MS08-067: KB958644
let details = client.details("9602ca4a-80a7-4d73-94c3-0088fcb5bce3").await;
match details {
Ok(d) => {
println!("title: {}", d.title);
println!("id: {}", d.id);
println!("kb: {}", d.kb);
println!("classification: {}", d.classification);
println!("last modified: {}", d.last_modified);
println!("size: {}", d.size);
println!("description: {}", d.description);
println!("architecture: {}", d.architecture);
println!("supported products: {}", d.supported_products);
println!("supported languages: {}", d.supported_languages);
println!("msrc number: {}", d.msrc_number);
println!("msrc severity: {}", d.msrc_severity);
println!("info url: {}", d.info_url);
println!("support url: {}", d.support_url);
println!("reboot behavior: {}", d.reboot_behavior);
println!("requires user input: {}", d.requires_user_input);
println!("is exclusive install: {}", d.is_exclusive_install);
println!("requires network connectivity: {}", d.requires_network_connectivity);
println!("uninstall notes: {}", d.uninstall_notes);
println!("uninstall steps: {}", d.uninstall_steps);
println!("supersedes: {}", d.supersedes);
println!("superseded by: {}", d.superseded_by);
},
Err(e) => println!("error: {}", e),
}
}
```
# Crate Features
The following crate features are available:
- `default`: async/await support
- `blocking`: blocking support
> **Note**: The `blocking` feature is mutually exclusive with the `default` feature.
*/