| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/utils.R |
| 3 |
\name{is_error_value} |
| 4 |
\alias{is_error_value} |
| 5 |
\alias{is_nul_byte} |
| 6 |
\title{Error Validators} |
| 7 |
\usage{ |
| 8 |
is_error_value(x) |
| 9 |
|
| 10 |
is_nul_byte(x) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{x}{an object.} |
| 14 |
} |
| 15 |
\value{ |
| 16 |
Logical value TRUE or FALSE. |
| 17 |
} |
| 18 |
\description{ |
| 19 |
Validator functions for error value types created by \pkg{nanonext}. |
| 20 |
} |
| 21 |
\details{ |
| 22 |
Is the object an error value generated by the package. All non-success |
| 23 |
integer return values are classed 'errorValue' to be distinguishable from |
| 24 |
integer message values. Includes error values returned after a timeout etc. |
| 25 |
|
| 26 |
Is the object a nul byte. |
| 27 |
} |
| 28 |
\examples{ |
| 29 |
s <- socket() |
| 30 |
r <- recv_aio(s, timeout = 10) |
| 31 |
call_aio(r)$data |
| 32 |
close(s) |
| 33 |
r$data == 5L |
| 34 |
is_error_value(r$data) |
| 35 |
is_error_value(5L) |
| 36 |
|
| 37 |
is_nul_byte(as.raw(0L)) |
| 38 |
is_nul_byte(raw(length = 1L)) |
| 39 |
is_nul_byte(writeBin("", con = raw())) |
| 40 |
is_nul_byte(0L) |
| 41 |
is_nul_byte(NULL) |
| 42 |
is_nul_byte(NA) |
| 43 |
|
| 44 |
} |