-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[breaking-change]: Re-export public types in the crate root.
This makes all internal modules private, and only exposes a bunch of public structs. To fix your code, where it says “struct `...` is private”, just remove preceding module name, for example: ``` examples/consumer.rs:4:5: 4:27 error: struct `Session` is private examples/consumer.rs:4 use amqp::session::Session; ``` change line to: ``` use amqp::Session; ```
- Loading branch information
Showing
13 changed files
with
71 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 0.0.12 | ||
|
||
Re-exported types from sub-modules to a crate level. | ||
Made most of the internals private. Made public only necessary things. | ||
|
||
Upgrading, in most cases requires removing preceding module name before struct: | ||
```rust | ||
use amqp::session::Session; | ||
use amqp::basic::Basic; | ||
use amqp::channel::Channel; | ||
``` | ||
will become something like: | ||
```rust | ||
use amqp::{Session, Basic, Channel}; | ||
``` | ||
The only things where you still use modules of are `protocol` and `table`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
extern crate amqp; | ||
extern crate env_logger; | ||
|
||
use amqp::session::Session; | ||
use amqp::protocol; | ||
use amqp::table; | ||
use amqp::basic::Basic; | ||
use amqp::channel::{Channel, ConsumerCallBackFn}; | ||
use amqp::{Basic, Session, Channel, ConsumerCallBackFn, Table, protocol}; | ||
use std::default::Default; | ||
use std::thread; | ||
|
||
|
@@ -22,6 +18,7 @@ fn consumer_function(channel: &mut Channel, deliver: protocol::basic::Deliver, h | |
|
||
fn main() { | ||
env_logger::init().unwrap(); | ||
let amqp_url = "amqp://xbisgjql:[email protected]/xbisgjql"; | ||
let amqp_url = "amqp://guest:[email protected]//"; | ||
let mut session = match Session::open_url(amqp_url) { | ||
Ok(session) => session, | ||
|
@@ -32,7 +29,7 @@ fn main() { | |
|
||
let queue_name = "test_queue"; | ||
//queue: &str, passive: bool, durable: bool, exclusive: bool, auto_delete: bool, nowait: bool, arguments: Table | ||
let queue_declare = channel.queue_declare(queue_name, false, true, false, false, false, table::new()); | ||
let queue_declare = channel.queue_declare(queue_name, false, true, false, false, false, Table::new()); | ||
println!("Queue declare: {:?}", queue_declare); | ||
for get_result in channel.basic_get(queue_name, false) { | ||
println!("Headers: {:?}", get_result.headers); | ||
|
@@ -43,7 +40,7 @@ fn main() { | |
|
||
//queue: &str, consumer_tag: &str, no_local: bool, no_ack: bool, exclusive: bool, nowait: bool, arguments: Table | ||
println!("Declaring consumer..."); | ||
let consumer_name = channel.basic_consume(consumer_function as ConsumerCallBackFn, queue_name, "", false, false, false, false, table::new()); | ||
let consumer_name = channel.basic_consume(consumer_function as ConsumerCallBackFn, queue_name, "", false, false, false, false, Table::new()); | ||
println!("Starting consumer {:?}", consumer_name); | ||
|
||
let consumers_thread = thread::spawn(move || { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters