Struct amqp::Channel
[−]
[src]
pub struct Channel { pub id: u16, // some fields omitted }
Fields
id: u16
Methods
impl Channel
[src]
fn new(id: u16,
receiver: Receiver<Result<Frame, AMQPError>>,
connection: Connection)
-> Channel
receiver: Receiver<Result<Frame, AMQPError>>,
connection: Connection)
-> Channel
fn open(&mut self) -> Result<OpenOk, AMQPError>
fn close<T>(&mut self,
reply_code: u16,
reply_text: T)
-> Result<CloseOk, AMQPError> where T: Into<String>
reply_code: u16,
reply_text: T)
-> Result<CloseOk, AMQPError> where T: Into<String>
fn read(&mut self) -> Result<Frame, AMQPError>
Will block until it reads a frame, other than basic.deliver
.
fn write(&mut self, frame: Frame) -> Result<(), AMQPError>
fn send_method_frame<T>(&mut self, method: &T) -> Result<(), AMQPError> where T: Method
fn rpc<I, O>(&mut self,
method: &I,
expected_reply: &str)
-> Result<O, AMQPError> where I: Method, O: Method
method: &I,
expected_reply: &str)
-> Result<O, AMQPError> where I: Method, O: Method
fn raw_rpc<T>(&mut self, method: &T) -> Result<MethodFrame, AMQPError> where T: Method
fn read_headers(&mut self) -> Result<ContentHeaderFrame, AMQPError>
fn read_body(&mut self, size: u64) -> Result<Vec<u8>, AMQPError>
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>
exchange: S,
_type: S,
passive: bool,
durable: bool,
auto_delete: bool,
internal: bool,
nowait: bool,
arguments: Table)
-> Result<DeclareOk, AMQPError> where S: Into<String>
fn exchange_bind<S>(&mut self,
destination: S,
source: S,
routing_key: S,
arguments: Table)
-> Result<BindOk, AMQPError> where S: Into<String>
destination: S,
source: S,
routing_key: S,
arguments: Table)
-> Result<BindOk, AMQPError> where S: Into<String>
fn queue_declare<S>(&mut self,
queue: S,
passive: bool,
durable: bool,
exclusive: bool,
auto_delete: bool,
nowait: bool,
arguments: Table)
-> Result<DeclareOk, AMQPError> where S: Into<String>
queue: S,
passive: bool,
durable: bool,
exclusive: bool,
auto_delete: bool,
nowait: bool,
arguments: Table)
-> Result<DeclareOk, AMQPError> where S: Into<String>
fn queue_bind<S>(&mut self,
queue: S,
exchange: S,
routing_key: S,
nowait: bool,
arguments: Table)
-> Result<BindOk, AMQPError> where S: Into<String>
queue: S,
exchange: S,
routing_key: S,
nowait: bool,
arguments: Table)
-> Result<BindOk, AMQPError> where S: Into<String>
fn set_frame_max_limit(&mut self, size: u32)
fn start_consuming(&mut self)
Trait Implementations
impl Send for Channel
[src]
impl<'a> Basic<'a> for Channel
[src]
fn basic_get(&'a mut self, queue: &'a str, no_ack: bool) -> GetIterator<'a>
Returns a basic iterator.
Example
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>
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>
fn basic_publish<S>(&mut self,
exchange: S,
routing_key: S,
mandatory: bool,
immediate: bool,
properties: BasicProperties,
content: Vec<u8>)
-> Result<(), AMQPError> where S: Into<String>
exchange: S,
routing_key: S,
mandatory: bool,
immediate: bool,
properties: BasicProperties,
content: Vec<u8>)
-> Result<(), AMQPError> where S: Into<String>
fn basic_ack(&mut self,
delivery_tag: u64,
multiple: bool)
-> Result<(), AMQPError>
delivery_tag: u64,
multiple: bool)
-> Result<(), AMQPError>
fn basic_nack(&mut self,
delivery_tag: u64,
multiple: bool,
requeue: bool)
-> Result<(), AMQPError>
delivery_tag: u64,
multiple: bool,
requeue: bool)
-> Result<(), AMQPError>
fn basic_reject(&mut self,
delivery_tag: u64,
requeue: bool)
-> Result<(), AMQPError>
delivery_tag: u64,
requeue: bool)
-> Result<(), AMQPError>
fn basic_prefetch(&mut self, prefetch_count: u16) -> Result<QosOk, AMQPError>
fn basic_qos(&mut self,
prefetch_size: u32,
prefetch_count: u16,
global: bool)
-> Result<QosOk, AMQPError>
prefetch_size: u32,
prefetch_count: u16,
global: bool)
-> Result<QosOk, AMQPError>
fn basic_cancel(&mut self,
consumer_tag: String,
no_wait: bool)
-> Result<CancelOk, AMQPError>
consumer_tag: String,
no_wait: bool)
-> Result<CancelOk, AMQPError>