package async_rpc_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type _ t =
  1. | Only_on_exn : _ t
    (*

    All responses are treated as successful. If your implementation raises an uncaught exn first, it will still be treated as an error.

    *)
  2. | Or_error : _ Core.Or_error.t t
    (*

    If the response is Error (_ : Error.t), it is treated as an error

    *)
  3. | Result : (_, _) Core.Result.t t
    (*

    If the response is Error _, it is treated as an error

    *)
  4. | Or_error_or_error : _ Core.Or_error.t Core.Or_error.t t
    (*

    If the response is Error (_ : Error.t) or Ok (Error (_ : Error.t)), it is treated as an error

    *)
  5. | Result_or_error : (_, _) Core.Result.t Core.Or_error.t t
    (*

    If the response is Error (_ : Error.t) or Ok (Error _), it is treated as an error

    *)
  6. | Or_error_result : (_ Core.Or_error.t, _) Core.Result.t t
    (*

    If the response is Error _ or Ok (Error (_ : Error.t)), it is treated as an error

    *)
  7. | Result_result : ((_, _) Core.Result.t, _) Core.Result.t t
    (*

    If the response is Error _ or Ok (Error _), it is treated as an error

    *)
  8. | On_none : _ Core.Option.t t
    (*

    If the response is None, it is treated as an error. For many APIs, it is reasonable to return no results, but you may still want to count these separately from nonempty responses.

    *)
  9. | Generic_or_error : 'inner t -> 'inner Core.Or_error.t t
    (*

    If the response is Error (_ : Error.t), it is treated as an error. If it is Ok x, the given rule is applied to x

    *)
  10. | Generic_result : 'inner t -> ('inner, _) Core.Result.t t
    (*

    If the response is Error _, it is treated as an error. If it is Ok x, the given rule is applied to x.

    *)
  11. | Generic_option : 'inner t -> 'inner Core.Option.t t
    (*

    If the response is None, it is treated as an error. If it is Some x, the given rule is applied to x.

    *)
  12. | Embedded : ('a -> 'b) * 'b t -> 'a t
    (*

    There is some value representing whether or not the rpc succeeded inside another object, e.g. you have a result inside a record with some other metadata.

    Embedded (f, rule) specifies a function, f, to extract the result and a t, rule, to determine if it is an error.

    *)
  13. | Custom : {
    1. is_error : 'a -> bool;
    } -> 'a t
    (*

    A function to decide if a result is an error. This is the most generic option and the most likely to be broken by future changes to the API.

    *)

An 'a t describes how Async_rpc can determine whether an rpc response of type 'a should count as an error. This does not affect serialization of responses. It only affects the tracing information that may be listened to.

module Private : sig ... end
OCaml

Innovation. Community. Security.