Allow to see the last request in async and pop it.

main
Laurent Pelecq 2 years ago
parent fe74259e43
commit b5ec9e37ad

@ -63,6 +63,16 @@ impl<S: Read + Write + Source> AsyncClient<S> {
self.requests.push_back(request);
}
/// Pop the last request in the queue.
pub fn pop(&mut self) -> Option<Request> {
self.requests.pop_back()
}
/// Last request in the queue.
pub fn last(&self) -> Option<&Request> {
self.requests.back()
}
/// Return true if there is a pending request.
pub fn has_next(&self) -> bool {
!self.requests.is_empty()

Loading…
Cancel
Save