sig
  val iter :
    Raw_scheduler.T.t ->
    check_access:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                   (unit -> unit) option)
                  Fieldslib.Field.t_with_perm ->
                  Raw_scheduler.T.t -> (unit -> unit) option -> 'a) ->
    jobs:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
           Raw_scheduler.Execution_context.t Job.t Jobs.t
           Core.Std.sexp_opaque)
          Fieldslib.Field.t_with_perm ->
          Raw_scheduler.T.t ->
          Raw_scheduler.Execution_context.t Job.t Jobs.t Core.Std.sexp_opaque ->
          'b) ->
    main_execution_context:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                             Raw_scheduler.Execution_context.t)
                            Fieldslib.Field.t_with_perm ->
                            Raw_scheduler.T.t ->
                            Raw_scheduler.Execution_context.t -> 'c) ->
    current_execution_context:(([< `Read | `Set_and_create ],
                                Raw_scheduler.T.t,
                                Raw_scheduler.Execution_context.t)
                               Fieldslib.Field.t_with_perm ->
                               Raw_scheduler.T.t ->
                               Raw_scheduler.Execution_context.t -> 'd) ->
    max_num_jobs_per_priority_per_cycle:(([< `Read | `Set_and_create ],
                                          Raw_scheduler.T.t, int)
                                         Fieldslib.Field.t_with_perm ->
                                         Raw_scheduler.T.t -> int -> 'e) ->
    uncaught_exn:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                   Core.Std.Error.t option)
                  Fieldslib.Field.t_with_perm ->
                  Raw_scheduler.T.t -> Core.Std.Error.t option -> 'f) ->
    global_kill_index:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                        Kill_index.t)
                       Fieldslib.Field.t_with_perm ->
                       Raw_scheduler.T.t -> Kill_index.t -> 'g) ->
    num_jobs_run:(([< `Read | `Set_and_create ], Raw_scheduler.T.t, int)
                  Fieldslib.Field.t_with_perm ->
                  Raw_scheduler.T.t -> int -> 'h) ->
    cycle_count:(([< `Read | `Set_and_create ], Raw_scheduler.T.t, int)
                 Fieldslib.Field.t_with_perm ->
                 Raw_scheduler.T.t -> int -> 'i) ->
    cycle_start:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                  Core.Std.Time.t)
                 Fieldslib.Field.t_with_perm ->
                 Raw_scheduler.T.t -> Core.Std.Time.t -> 'j) ->
    last_cycle_time:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                      Core.Std.Time.Span.t)
                     Fieldslib.Field.t_with_perm ->
                     Raw_scheduler.T.t -> Core.Std.Time.Span.t -> 'k) ->
    cycle_times:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                  Core.Std.Time.Span.t Raw_scheduler.tail)
                 Fieldslib.Field.t_with_perm ->
                 Raw_scheduler.T.t ->
                 Core.Std.Time.Span.t Raw_scheduler.tail -> 'l) ->
    last_cycle_num_jobs:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                          int)
                         Fieldslib.Field.t_with_perm ->
                         Raw_scheduler.T.t -> int -> 'm) ->
    cycle_num_jobs:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                     int Raw_scheduler.tail)
                    Fieldslib.Field.t_with_perm ->
                    Raw_scheduler.T.t -> int Raw_scheduler.tail -> 'n) ->
    events:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
             Raw_scheduler.Execution_context.t Job.t Events.t)
            Fieldslib.Field.t_with_perm ->
            Raw_scheduler.T.t ->
            Raw_scheduler.Execution_context.t Job.t Events.t -> 'o) ->
    finalizer_jobs:(([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                     Raw_scheduler.Execution_context.t Job.t
                     Core.Std.Thread_safe_queue.t Core.Std.sexp_opaque)
                    Fieldslib.Field.t_with_perm ->
                    Raw_scheduler.T.t ->
                    Raw_scheduler.Execution_context.t Job.t
                    Core.Std.Thread_safe_queue.t Core.Std.sexp_opaque -> 'p) ->
    thread_safe_finalizer_hook:(([< `Read | `Set_and_create ],
                                 Raw_scheduler.T.t, unit -> unit)
                                Fieldslib.Field.t_with_perm ->
                                Raw_scheduler.T.t -> (unit -> unit) -> 'q) ->
    'q
  val fold :
    Raw_scheduler.T.t ->
    init:'->
    check_access:('->
                  ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                   (unit -> unit) option)
                  Fieldslib.Field.t_with_perm ->
                  Raw_scheduler.T.t -> (unit -> unit) option -> 'b) ->
    jobs:('->
          ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
           Raw_scheduler.Execution_context.t Job.t Jobs.t
           Core.Std.sexp_opaque)
          Fieldslib.Field.t_with_perm ->
          Raw_scheduler.T.t ->
          Raw_scheduler.Execution_context.t Job.t Jobs.t Core.Std.sexp_opaque ->
          'c) ->
    main_execution_context:('->
                            ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                             Raw_scheduler.Execution_context.t)
                            Fieldslib.Field.t_with_perm ->
                            Raw_scheduler.T.t ->
                            Raw_scheduler.Execution_context.t -> 'd) ->
    current_execution_context:('->
                               ([< `Read | `Set_and_create ],
                                Raw_scheduler.T.t,
                                Raw_scheduler.Execution_context.t)
                               Fieldslib.Field.t_with_perm ->
                               Raw_scheduler.T.t ->
                               Raw_scheduler.Execution_context.t -> 'e) ->
    max_num_jobs_per_priority_per_cycle:('->
                                         ([< `Read | `Set_and_create ],
                                          Raw_scheduler.T.t, int)
                                         Fieldslib.Field.t_with_perm ->
                                         Raw_scheduler.T.t -> int -> 'f) ->
    uncaught_exn:('->
                  ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                   Core.Std.Error.t option)
                  Fieldslib.Field.t_with_perm ->
                  Raw_scheduler.T.t -> Core.Std.Error.t option -> 'g) ->
    global_kill_index:('->
                       ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                        Kill_index.t)
                       Fieldslib.Field.t_with_perm ->
                       Raw_scheduler.T.t -> Kill_index.t -> 'h) ->
    num_jobs_run:('->
                  ([< `Read | `Set_and_create ], Raw_scheduler.T.t, int)
                  Fieldslib.Field.t_with_perm ->
                  Raw_scheduler.T.t -> int -> 'i) ->
    cycle_count:('->
                 ([< `Read | `Set_and_create ], Raw_scheduler.T.t, int)
                 Fieldslib.Field.t_with_perm ->
                 Raw_scheduler.T.t -> int -> 'j) ->
    cycle_start:('->
                 ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                  Core.Std.Time.t)
                 Fieldslib.Field.t_with_perm ->
                 Raw_scheduler.T.t -> Core.Std.Time.t -> 'k) ->
    last_cycle_time:('->
                     ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                      Core.Std.Time.Span.t)
                     Fieldslib.Field.t_with_perm ->
                     Raw_scheduler.T.t -> Core.Std.Time.Span.t -> 'l) ->
    cycle_times:('->
                 ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                  Core.Std.Time.Span.t Raw_scheduler.tail)
                 Fieldslib.Field.t_with_perm ->
                 Raw_scheduler.T.t ->
                 Core.Std.Time.Span.t Raw_scheduler.tail -> 'm) ->
    last_cycle_num_jobs:('->
                         ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                          int)
                         Fieldslib.Field.t_with_perm ->
                         Raw_scheduler.T.t -> int -> 'n) ->
    cycle_num_jobs:('->
                    ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                     int Raw_scheduler.tail)
                    Fieldslib.Field.t_with_perm ->
                    Raw_scheduler.T.t -> int Raw_scheduler.tail -> 'o) ->
    events:('->
            ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
             Raw_scheduler.Execution_context.t Job.t Events.t)
            Fieldslib.Field.t_with_perm ->
            Raw_scheduler.T.t ->
            Raw_scheduler.Execution_context.t Job.t Events.t -> 'p) ->
    finalizer_jobs:('->
                    ([< `Read | `Set_and_create ], Raw_scheduler.T.t,
                     Raw_scheduler.Execution_context.t Job.t
                     Core.Std.Thread_safe_queue.t Core.Std.sexp_opaque)
                    Fieldslib.Field.t_with_perm ->
                    Raw_scheduler.T.t ->
                    Raw_scheduler.Execution_context.t Job.t
                    Core.Std.Thread_safe_queue.t Core.Std.sexp_opaque -> 'q) ->
    thread_safe_finalizer_hook:('->
                                ([< `Read | `Set_and_create ],
                                 Raw_scheduler.T.t, unit -> unit)
                                Fieldslib.Field.t_with_perm ->
                                Raw_scheduler.T.t -> (unit -> unit) -> 'r) ->
    'r
end