Struct mio_httpc::SimpleCall
source · pub struct SimpleCall { /* private fields */ }
Expand description
Simplified API for non-streaming requests and responses. If body exists it needs to be provided to Request. If response has a body it is returned in Response.
Implementations
sourceimpl SimpleCall
impl SimpleCall
pub fn is_ref(&self, r: CallRef) -> bool
pub fn call(&self) -> &Call
sourcepub fn finish_inplace(&mut self) -> Option<(Response, Vec<u8>)>
pub fn finish_inplace(&mut self) -> Option<(Response, Vec<u8>)>
Replaces self with an empty SimpleCall and returns result if any.
sourcepub fn abort_inplace(&mut self, htp: &mut Httpc)
pub fn abort_inplace(&mut self, htp: &mut Httpc)
Abort and replace self with an empty call.
sourcepub fn is_call(&self, cid: &Option<CallRef>) -> bool
pub fn is_call(&self, cid: &Option<CallRef>) -> bool
For quick comparison with httpc::event response. If cid is none will return false.
sourcepub fn is_opt_callid(a: &Option<SimpleCall>, b: &Option<CallRef>) -> bool
pub fn is_opt_callid(a: &Option<SimpleCall>, b: &Option<CallRef>) -> bool
If using Option
sourcepub fn is_receiving(&self) -> bool
pub fn is_receiving(&self) -> bool
Are we in receiving state
sourcepub fn perform(&mut self, htp: &mut Httpc, poll: &Poll) -> Result<bool>
pub fn perform(&mut self, htp: &mut Httpc, poll: &Poll) -> Result<bool>
Perform operation. Returns true if request is finished.
sourcepub fn empty() -> SimpleCall
pub fn empty() -> SimpleCall
An empty SimpleCall not associated with a valid mio::Token/CallId. Exists to be overwritten with an actual valid request. Always returns is_done true.
pub fn is_empty(&self) -> bool
Trait Implementations
sourceimpl From<Call> for SimpleCall
impl From<Call> for SimpleCall
sourcefn from(v: Call) -> SimpleCall
fn from(v: Call) -> SimpleCall
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for SimpleCall
impl Send for SimpleCall
impl Sync for SimpleCall
impl Unpin for SimpleCall
impl UnwindSafe for SimpleCall
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more