pub struct Connection { /* private fields */ }Expand description
Connection handles a single AGI stream (a connection originating from a client).
commands are sent with connection::Connection::send_command
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn send_command<H>(
&mut self,
command: H,
) -> Result<AGIResponse<H::Response>, AGIError>where
H: AGICommand,
pub async fn send_command<H>(
&mut self,
command: H,
) -> Result<AGIResponse<H::Response>, AGIError>where
H: AGICommand,
Send an AGI Command over this connection.
Return an Error when sending fails or we do not get a Status message as a response. non-200 status codes are returned as Ok(the-status) and are NOT an Err as far as this method is concerned.
Note that the precice return type depends on the command sent.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Connection
impl RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more