pub struct Channel {
pub id: u16,
// some fields omitted
}
Will block until it reads a frame, other than basic.deliver
.
pub fn exchange_declare<S>( &mut self, exchange: S, _type: S, passive: bool, durable: bool, auto_delete: bool, internal: bool, nowait: bool, arguments: Table ) -> Result<DeclareOk, AMQPError> where S: Into<String>, | [src] |
Returns a basic iterator.
use std::default::Default;
use amqp::{Options, Session, Basic};
let mut session = match Session::new(Options { .. Default::default() }){
Ok(session) => session,
Err(error) => panic!("Failed openning an amqp session: {:?}", error)
};
let mut channel = session.open_channel(1).ok().expect("Can not open a channel");
for get_result in channel.basic_get("my queue", false) {
println!("Headers: {:?}", get_result.headers);
println!("Reply: {:?}", get_result.reply);
println!("Body: {:?}", String::from_utf8_lossy(&get_result.body));
get_result.ack();
}
fn basic_consume<T, S>( &mut self, callback: T, queue: S, consumer_tag: S, no_local: bool, no_ack: bool, exclusive: bool, nowait: bool, arguments: Table ) -> Result<String, AMQPError> where T: Consumer + 'static, S: Into<String>, | [src] |
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static