[−][src]Struct lapin_async::connection::Connection
Fields
status: ConnectionStatus
current state of the connection. In normal use it should always be ConnectionState::Connected
channels: Channels
configuration: Configuration
Methods
impl Connection
[src]
pub fn new() -> Self
[src]
creates a Connection
object in initial state
pub fn create_channel(&self) -> Result<Channel, Error>
[src]
pub fn connect(
&self,
credentials: Credentials,
options: ConnectionProperties
) -> Result<ConnectionState, Error>
[src]
&self,
credentials: Credentials,
options: ConnectionProperties
) -> Result<ConnectionState, Error>
starts the process of connecting to the server
this will set up the state machine and generates the required messages.
The messages will not be sent until calls to serialize
to write the messages to a buffer, or calls to next_frame
to obtain the next message to send
pub fn send_frame(&self, frame: AMQPFrame)
[src]
pub fn next_frame(&self) -> Option<AMQPFrame>
[src]
next message to send to the network
returns None if there's no message to send
pub fn serialize(
&self,
send_buffer: &mut [u8]
) -> Result<(usize, ConnectionState), Error>
[src]
&self,
send_buffer: &mut [u8]
) -> Result<(usize, ConnectionState), Error>
writes the next message to a mutable byte slice
returns how many bytes were written and the current state. this method can be called repeatedly until the buffer is full or there are no more frames to send
pub fn parse(&self, data: &[u8]) -> Result<(usize, ConnectionState), Error>
[src]
parses a frame from a byte slice
returns how many bytes were consumed and the current state.
This method will update the state machine according to the ReceivedStart
frame with handle_frame
pub fn handle_frame(&self, f: AMQPFrame) -> Result<(), Error>
[src]
updates the current state with a new received frame
pub fn set_closing(&self)
[src]
pub fn set_closed(&self) -> Result<(), Error>
[src]
pub fn set_error(&self) -> Result<(), Error>
[src]
impl Connection
[src]
pub fn run<T: Read + Write>(
&mut self,
stream: &mut T,
send_buffer: &mut Buffer,
receive_buffer: &mut Buffer
) -> Result<ConnectionState, Error>
[src]
&mut self,
stream: &mut T,
send_buffer: &mut Buffer,
receive_buffer: &mut Buffer
) -> Result<ConnectionState, Error>
helper function to handle reading and writing repeatedly from the network until there's no more state to update
Trait Implementations
impl Default for Connection
[src]
impl Clone for Connection
[src]
fn clone(&self) -> Connection
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Connection
[src]
Auto Trait Implementations
impl Send for Connection
impl Sync for Connection
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,