aboutsummaryrefslogblamecommitdiffstats
path: root/lib/protocols/Addressable.ml
blob: 7e97f08867916db57e58e54b4c848634fc2d9f0c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                         
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)