% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ncurl.R
\name{as.promise.ncurlAio}
\alias{as.promise.ncurlAio}
\title{Make ncurlAio Promise}
\usage{
\method{as.promise}{ncurlAio}(x)
}
\arguments{
\item{x}{an object of class 'ncurlAio'.}
}
\value{
A 'promise' object.
}
\description{
Creates a 'promise' from an 'ncurlAio' object.
}
\details{
This function is an S3 method for the generic \code{as.promise} for class
'ncurlAio'.

Requires the \pkg{promises} package.

Allows an 'ncurlAio' to be used with functions such as \code{promises::then()},
which schedules a function to run upon resolution of the Aio.

The promise is resolved with a list of 'status', 'headers' and 'data' or
rejected with the error translation if an NNG error is returned e.g. for an
invalid address.
}
