aboutsummaryrefslogtreecommitdiffstats
path: root/lib/protocols/Addressable.ml
blob: e4ba5b5ac30e03a3f7a7c3b22c1ed28f53920fb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
class type implementation = object
  method address : Concepts.Hash.hash
end

type Handle.protocol += Addressable of implementation
type t = implementation

let make impl = Addressable (impl :> implementation)
let from handle = Handle.into handle (function Addressable impl -> Some impl | _ -> None)
let address i = Handle.invoke i (fun o -> o#address)