Int_result.t
is used instead of 'a result
, if a function returns either an error or a non-negative integer (including unit/bool).
val is_error : 'a t -> bool
will raise Invalid_argument
, if is_ok
is false
will raise Invalid_argument
, if is_error
is false
return a plain integer number, positive or negative
val to_exn : ?name:string -> ?param:string -> 'a t -> exn
will raise Invalid_argument
, if is_error
is false
val raise_exn : ?name:string -> ?param:string -> 'a t -> 'b
You can use the following values to compare a Int_result.t value with an assumed error, e.g.
let p = Uwt.Stream.try_write t ~buf in
if (p :> int) = Uwt.Int_result.eagain then
...
else
...
All values are negative integers, but don't make any further assumption about them. Their concrete values can change with any uwt release.
val eprotonosupport : int