Debian Codegraph @

man/is.promise.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/promise.R
3 \name{is.promise}
4 \alias{is.promise}
5 \alias{is.promising}
6 \alias{as.promise}
7 \title{Coerce to a promise}
8 \usage{
9 is.promise(x)
10
11 is.promising(x)
12
13 as.promise(x)
14 }
15 \arguments{
16 \item{x}{An R object to test or coerce.}
17 }
18 \value{
19 \code{as.promise} returns a promise object, or throws an error if the
20 object cannot be converted.
21
22 \code{is.promise} returns \code{TRUE} if the given value is a promise object, and
23 \code{FALSE} otherwise.
24
25 \code{is.promising} returns \code{TRUE} if the given value is a promise object or
26 if it can be converted to a promise object using \code{as.promise}, and \code{FALSE}
27 otherwise.
28 }
29 \description{
30 Use \code{is.promise} to determine whether an R object is a promise. Use
31 \code{as.promise} (an S3 generic method) to attempt to coerce an R object to a
32 promise, and \code{is.promising} (another S3 generic method) to test whether
33 \code{as.promise} is supported. \link[mirai:mirai]{mirai::mirai} objects have an \code{as.promise} method
34 defined in the mirai package, and this package provides one for converting
35 \link[future:Future-class]{future::Future} objects into promises.
36 }