mirror of
https://github.com/zap-proto/ocaml-rpc.git
synced 2026-10-30 15:04:28 +00:00
Makes it match the new package names, and also will shrink the diff for the Eio port.
18 lines
425 B
OCaml
18 lines
425 B
OCaml
type 'a t
|
|
(** An ['a t] is a weak pointer to an ['a]. *)
|
|
|
|
val empty : unit -> 'a t
|
|
(** [empty ()] is a fresh empty pointer. *)
|
|
|
|
val wrap : 'a -> 'a t
|
|
(** [wrap x] is a weak pointer to [x]. *)
|
|
|
|
val get : 'a t -> 'a option
|
|
(** [get t] is the target of [t], or [None] if it has been GC'd. *)
|
|
|
|
val set : 'a t -> 'a -> unit
|
|
(** [set t x] puts [x] in the pointer. *)
|
|
|
|
val clear : 'a t -> unit
|
|
(** [clear t] empties the pointer. *)
|