pub struct QueuedClient<S: Read + Write + Source> { /* private fields */ }
Expand description
Implementations§
Source§impl<S: Read + Write + Source> QueuedClient<S>
impl<S: Read + Write + Source> QueuedClient<S>
Sourcepub fn new(client: Client<S>) -> Self
pub fn new(client: Client<S>) -> Self
New asynchronous client build on top of a synchronous client.
Sourcepub fn input_source(&self) -> &S
pub fn input_source(&self) -> &S
Input source.
Sourcepub fn output_source(&self) -> &S
pub fn output_source(&self) -> &S
Output source.
Sourcepub fn register(
&mut self,
poll: &Poll,
input_token: Token,
output_token: Token,
) -> Result<()>
pub fn register( &mut self, poll: &Poll, input_token: Token, output_token: Token, ) -> Result<()>
Register client
Sourcepub fn has_data_next(&self) -> bool
pub fn has_data_next(&self) -> bool
Return true if there is a pending request to send data.
After a Speak
has been sent, when the client receives OK_RECEIVING_DATA
, the
next command must be Request::SendLine
or Request::SendLines
.
Sourcepub fn send_next(&mut self) -> ClientResult<bool>
pub fn send_next(&mut self) -> ClientResult<bool>
Write one pending request if any.
Instance of mio::Poll
generates a writable event only once until the socket returns WouldBlock
.
This error is mapped to ClientError::NotReady
.
Sourcepub fn receive_next(&mut self) -> ClientResult<Response>
pub fn receive_next(&mut self) -> ClientResult<Response>
Receive one response.
Must be called each time a readable event is returned by mio::Poll
.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for QueuedClient<S>where
S: Freeze,
impl<S> RefUnwindSafe for QueuedClient<S>where
S: RefUnwindSafe,
impl<S> Send for QueuedClient<S>where
S: Send,
impl<S> Sync for QueuedClient<S>where
S: Sync,
impl<S> Unpin for QueuedClient<S>where
S: Unpin,
impl<S> UnwindSafe for QueuedClient<S>where
S: UnwindSafe,
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