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§
source§impl 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: &Registry) -> Result<bool>
pub fn perform(&mut self, htp: &mut Httpc, poll: &Registry) -> 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§
source§impl From<Call> for SimpleCall
impl From<Call> for SimpleCall
source§fn from(v: Call) -> SimpleCall
fn from(v: Call) -> SimpleCall
Converts to this type from the input type.