Struct lapin_async::connection::Connection
[−]
[src]
pub struct Connection { pub state: ConnectionState, pub channels: HashMap<u16, Channel>, pub configuration: Configuration, pub channel_index: u16, pub prefetch_size: u32, pub prefetch_count: u16, pub frame_queue: VecDeque<Frame>, pub request_index: RequestId, pub finished_reqs: HashSet<RequestId>, }
Fields
state: ConnectionState
channels: HashMap<u16, Channel>
configuration: Configuration
channel_index: u16
prefetch_size: u32
prefetch_count: u16
frame_queue: VecDeque<Frame>
request_index: RequestId
finished_reqs: HashSet<RequestId>
Methods
impl Connection
[src]
fn run<T>(&mut self,
stream: &mut T,
send_buffer: &mut Buffer,
receive_buffer: &mut Buffer)
-> Result<ConnectionState> where T: Read + Write
stream: &mut T,
send_buffer: &mut Buffer,
receive_buffer: &mut Buffer)
-> Result<ConnectionState> where T: Read + Write
fn can_write(&self, send_buffer: &Buffer) -> bool
fn can_read(&self, receive_buffer: &Buffer) -> bool
fn can_parse(&self, receive_buffer: &Buffer) -> bool
fn write_to_stream(&mut self,
writer: &mut Write,
send_buffer: &mut Buffer)
-> Result<(usize, ConnectionState)>
writer: &mut Write,
send_buffer: &mut Buffer)
-> Result<(usize, ConnectionState)>
fn read_from_stream(&mut self,
reader: &mut Read,
receive_buffer: &mut Buffer)
-> Result<(usize, ConnectionState)>
reader: &mut Read,
receive_buffer: &mut Buffer)
-> Result<(usize, ConnectionState)>
impl Connection
[src]
fn new() -> Connection
fn create_channel(&mut self) -> u16
fn set_channel_state(&mut self, channel_id: u16, new_state: ChannelState)
fn check_state(&self, channel_id: u16, state: ChannelState) -> Option<bool>
fn get_state(&self, channel_id: u16) -> Option<ChannelState>
fn push_back_answer(&mut self, channel_id: u16, answer: Answer)
fn check_next_answer(&self, channel_id: u16, answer: Answer) -> bool
fn get_next_answer(&mut self, channel_id: u16) -> Option<Answer>
fn is_connected(&self, channel_id: u16) -> bool
fn next_request_id(&mut self) -> RequestId
fn is_finished(&mut self, id: RequestId) -> bool
fn next_message(&mut self,
channel_id: u16,
queue_name: &str,
consumer_tag: &str)
-> Option<Message>
channel_id: u16,
queue_name: &str,
consumer_tag: &str)
-> Option<Message>
fn connect(&mut self) -> Result<ConnectionState>
fn next_frame(&mut self) -> Option<Frame>
fn serialize(&mut self,
send_buffer: &mut [u8])
-> Result<(usize, ConnectionState)>
send_buffer: &mut [u8])
-> Result<(usize, ConnectionState)>
fn parse(&mut self, data: &[u8]) -> Result<(usize, ConnectionState)>
fn handle_frame(&mut self, f: Frame)
fn handle_global_method(&mut self, c: Class)
fn handle_content_header_frame(&mut self, channel_id: u16, size: u64)
fn handle_body_frame(&mut self, channel_id: u16, payload: Vec<u8>)
fn send_content_frames(&mut self, channel_id: u16, class_id: u16, slice: &[u8])
fn send_method_frame(&mut self,
channel: u16,
method: Class)
-> Result<(), Error>
channel: u16,
method: Class)
-> Result<(), Error>
impl Connection
[src]
fn receive_method(&mut self,
channel_id: u16,
method: Class)
-> Result<(), Error>
channel_id: u16,
method: Class)
-> Result<(), Error>
fn channel_open(&mut self,
_channel_id: u16,
out_of_band: ShortString)
-> Result<RequestId, Error>
_channel_id: u16,
out_of_band: ShortString)
-> Result<RequestId, Error>
fn receive_channel_open_ok(&mut self,
_channel_id: u16,
_: OpenOk)
-> Result<(), Error>
_channel_id: u16,
_: OpenOk)
-> Result<(), Error>
fn channel_flow(&mut self,
_channel_id: u16,
active: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
active: Boolean)
-> Result<RequestId, Error>
fn receive_channel_flow(&mut self,
_channel_id: u16,
method: Flow)
-> Result<(), Error>
_channel_id: u16,
method: Flow)
-> Result<(), Error>
fn channel_flow_ok(&mut self,
_channel_id: u16,
active: Boolean)
-> Result<(), Error>
_channel_id: u16,
active: Boolean)
-> Result<(), Error>
fn receive_channel_flow_ok(&mut self,
_channel_id: u16,
method: FlowOk)
-> Result<(), Error>
_channel_id: u16,
method: FlowOk)
-> Result<(), Error>
fn channel_close(&mut self,
_channel_id: u16,
reply_code: ShortUInt,
reply_text: ShortString,
class_id: ShortUInt,
method_id: ShortUInt)
-> Result<RequestId, Error>
_channel_id: u16,
reply_code: ShortUInt,
reply_text: ShortString,
class_id: ShortUInt,
method_id: ShortUInt)
-> Result<RequestId, Error>
fn receive_channel_close(&mut self,
_channel_id: u16,
_: Close)
-> Result<(), Error>
_channel_id: u16,
_: Close)
-> Result<(), Error>
fn channel_close_ok(&mut self, _channel_id: u16) -> Result<(), Error>
fn receive_channel_close_ok(&mut self,
_channel_id: u16,
_: CloseOk)
-> Result<(), Error>
_channel_id: u16,
_: CloseOk)
-> Result<(), Error>
fn queue_declare(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
passive: Boolean,
durable: Boolean,
exclusive: Boolean,
auto_delete: Boolean,
nowait: Boolean,
arguments: FieldTable)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
passive: Boolean,
durable: Boolean,
exclusive: Boolean,
auto_delete: Boolean,
nowait: Boolean,
arguments: FieldTable)
-> Result<RequestId, Error>
fn receive_queue_declare_ok(&mut self,
_channel_id: u16,
method: DeclareOk)
-> Result<(), Error>
_channel_id: u16,
method: DeclareOk)
-> Result<(), Error>
fn queue_bind(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
exchange: ShortString,
routing_key: ShortString,
nowait: Boolean,
arguments: FieldTable)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
exchange: ShortString,
routing_key: ShortString,
nowait: Boolean,
arguments: FieldTable)
-> Result<RequestId, Error>
fn receive_queue_bind_ok(&mut self,
_channel_id: u16,
_: BindOk)
-> Result<(), Error>
_channel_id: u16,
_: BindOk)
-> Result<(), Error>
fn queue_purge(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
nowait: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
nowait: Boolean)
-> Result<RequestId, Error>
fn receive_queue_purge_ok(&mut self,
_channel_id: u16,
_: PurgeOk)
-> Result<(), Error>
_channel_id: u16,
_: PurgeOk)
-> Result<(), Error>
fn queue_delete(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
if_unused: Boolean,
if_empty: Boolean,
nowait: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
if_unused: Boolean,
if_empty: Boolean,
nowait: Boolean)
-> Result<RequestId, Error>
fn receive_queue_delete_ok(&mut self,
_channel_id: u16,
_: DeleteOk)
-> Result<(), Error>
_channel_id: u16,
_: DeleteOk)
-> Result<(), Error>
fn queue_unbind(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
exchange: ShortString,
routing_key: ShortString,
arguments: FieldTable)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
exchange: ShortString,
routing_key: ShortString,
arguments: FieldTable)
-> Result<RequestId, Error>
fn receive_queue_unbind_ok(&mut self,
_channel_id: u16,
_: UnbindOk)
-> Result<(), Error>
_channel_id: u16,
_: UnbindOk)
-> Result<(), Error>
fn basic_qos(&mut self,
_channel_id: u16,
prefetch_size: LongUInt,
prefetch_count: ShortUInt,
global: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
prefetch_size: LongUInt,
prefetch_count: ShortUInt,
global: Boolean)
-> Result<RequestId, Error>
fn receive_basic_qos_ok(&mut self,
_channel_id: u16,
_: QosOk)
-> Result<(), Error>
_channel_id: u16,
_: QosOk)
-> Result<(), Error>
fn basic_consume(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
consumer_tag: ShortString,
no_local: Boolean,
no_ack: Boolean,
exclusive: Boolean,
nowait: Boolean,
arguments: FieldTable)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
consumer_tag: ShortString,
no_local: Boolean,
no_ack: Boolean,
exclusive: Boolean,
nowait: Boolean,
arguments: FieldTable)
-> Result<RequestId, Error>
fn receive_basic_consume_ok(&mut self,
_channel_id: u16,
method: ConsumeOk)
-> Result<(), Error>
_channel_id: u16,
method: ConsumeOk)
-> Result<(), Error>
fn basic_cancel(&mut self,
_channel_id: u16,
consumer_tag: ShortString,
nowait: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
consumer_tag: ShortString,
nowait: Boolean)
-> Result<RequestId, Error>
fn receive_basic_cancel_ok(&mut self,
_channel_id: u16,
method: CancelOk)
-> Result<(), Error>
_channel_id: u16,
method: CancelOk)
-> Result<(), Error>
fn basic_publish(&mut self,
_channel_id: u16,
ticket: ShortUInt,
exchange: ShortString,
routing_key: ShortString,
mandatory: Boolean,
immediate: Boolean)
-> Result<(), Error>
_channel_id: u16,
ticket: ShortUInt,
exchange: ShortString,
routing_key: ShortString,
mandatory: Boolean,
immediate: Boolean)
-> Result<(), Error>
fn receive_basic_amqp_return(&mut self,
_channel_id: u16,
_: Return)
-> Result<(), Error>
_channel_id: u16,
_: Return)
-> Result<(), Error>
fn receive_basic_deliver(&mut self,
_channel_id: u16,
method: Deliver)
-> Result<(), Error>
_channel_id: u16,
method: Deliver)
-> Result<(), Error>
fn basic_get(&mut self,
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
no_ack: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
ticket: ShortUInt,
queue: ShortString,
no_ack: Boolean)
-> Result<RequestId, Error>
fn receive_basic_get_ok(&mut self,
_channel_id: u16,
_: GetOk)
-> Result<(), Error>
_channel_id: u16,
_: GetOk)
-> Result<(), Error>
fn receive_basic_get_empty(&mut self,
_channel_id: u16,
_: GetEmpty)
-> Result<(), Error>
_channel_id: u16,
_: GetEmpty)
-> Result<(), Error>
fn basic_ack(&mut self,
_channel_id: u16,
delivery_tag: LongLongUInt,
multiple: Boolean)
-> Result<(), Error>
_channel_id: u16,
delivery_tag: LongLongUInt,
multiple: Boolean)
-> Result<(), Error>
fn basic_reject(&mut self,
_channel_id: u16,
delivery_tag: LongLongUInt,
requeue: Boolean)
-> Result<(), Error>
_channel_id: u16,
delivery_tag: LongLongUInt,
requeue: Boolean)
-> Result<(), Error>
fn basic_recover_async(&mut self,
_channel_id: u16,
requeue: Boolean)
-> Result<(), Error>
_channel_id: u16,
requeue: Boolean)
-> Result<(), Error>
fn basic_recover(&mut self,
_channel_id: u16,
requeue: Boolean)
-> Result<RequestId, Error>
_channel_id: u16,
requeue: Boolean)
-> Result<RequestId, Error>
fn receive_basic_recover_ok(&mut self,
_channel_id: u16,
_: RecoverOk)
-> Result<(), Error>
_channel_id: u16,
_: RecoverOk)
-> Result<(), Error>
fn basic_nack(&mut self,
_channel_id: u16,
delivery_tag: LongLongUInt,
multiple: Boolean,
requeue: Boolean)
-> Result<(), Error>
_channel_id: u16,
delivery_tag: LongLongUInt,
multiple: Boolean,
requeue: Boolean)
-> Result<(), Error>
Trait Implementations
impl Clone for Connection
[src]
fn clone(&self) -> Connection
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Connection
[src]
impl PartialEq for Connection
[src]
fn eq(&self, __arg_0: &Connection) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Connection) -> bool
This method tests for !=
.