[][src]Trait libuv::requests::req::ReqTrait

pub trait ReqTrait: ToReq {
    fn cancel(&mut self) -> Result<()> { ... }
fn get_type(&self) -> ReqType { ... } }

Provided methods

fn cancel(&mut self) -> Result<()>

Cancel a pending request. Fails if the request is executing or has finished executing.

Only cancellation of FsReq, GetAddrInfoReq, GetNameInfoReq, RandomReq and WorkReq requests is currently supported.

Cancelled requests have their callbacks invoked some time in the future. It’s not safe to free the memory associated with the request until the callback is called.

Here is how cancellation is reported to the callback:

  • A FsReq request has its req->result field set to UV_ECANCELED.
  • A WorkReq, GetAddrInfoReq, GetNameInfoReq or RandomReq request has its callback invoked with status == UV_ECANCELED.

fn get_type(&self) -> ReqType

Returns the type of the request.

Loading content...

Implementors

impl ReqTrait for ConnectReq[src]

impl ReqTrait for FsReq[src]

impl ReqTrait for GetAddrInfoReq[src]

impl ReqTrait for GetNameInfoReq[src]

impl ReqTrait for RandomReq[src]

impl ReqTrait for Req[src]

impl ReqTrait for ShutdownReq[src]

impl ReqTrait for UdpSendReq[src]

impl ReqTrait for WorkReq[src]

impl ReqTrait for WriteReq[src]

Loading content...