[][src]Struct amqp::Channel

pub struct Channel {
    pub id: u16,
    // some fields omitted
}

Fields

id: u16

Methods

impl Channel
[src]

pub fn new(
    id: u16,
    receiver: Receiver<Result<Frame, AMQPError>>,
    connection: Connection
) -> Channel
[src]

pub fn open(&mut self) -> Result<OpenOk, AMQPError>
[src]

pub fn close<T>(
    &mut self,
    reply_code: u16,
    reply_text: T
) -> Result<CloseOk, AMQPError> where
    T: Into<String>, 
[src]

pub fn read(&mut self) -> Result<Frame, AMQPError>
[src]

Will block until it reads a frame, other than basic.deliver.

pub fn write(&mut self, frame: Frame) -> Result<(), AMQPError>
[src]

pub fn send_method_frame<T>(&mut self, method: &T) -> Result<(), AMQPError> where
    T: Method
[src]

pub fn rpc<I, O>(
    &mut self,
    method: &I,
    expected_reply: &str
) -> Result<O, AMQPError> where
    I: Method,
    O: Method
[src]

pub fn raw_rpc<T>(&mut self, method: &T) -> Result<MethodFrame, AMQPError> where
    T: Method
[src]

pub fn read_headers(&mut self) -> Result<ContentHeaderFrame, AMQPError>
[src]

pub fn read_body(&mut self, size: u64) -> Result<Vec<u8>, AMQPError>
[src]

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]

pub fn exchange_bind<S>(
    &mut self,
    destination: S,
    source: S,
    routing_key: S,
    arguments: Table
) -> Result<BindOk, AMQPError> where
    S: Into<String>, 
[src]

pub 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>, 
[src]

pub fn queue_bind<S>(
    &mut self,
    queue: S,
    exchange: S,
    routing_key: S,
    nowait: bool,
    arguments: Table
) -> Result<BindOk, AMQPError> where
    S: Into<String>, 
[src]

pub fn set_frame_max_limit(&mut self, size: u32)
[src]

pub fn start_consuming(&mut self)
[src]

Trait Implementations

impl<'a> Basic<'a> for Channel
[src]

fn basic_get(&'a mut self, queue: &'a str, no_ack: bool) -> GetIterator<'a>
[src]

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();
}

impl Send for Channel
[src]

Auto Trait Implementations

impl !Sync for Channel

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]