aboutsummaryrefslogtreecommitdiffstats
path: root/lib/protocols/Directory.ml
blob: 5b21668c6dacf222132fdeae03ab853570a68238 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class type implementation = object
  method list : string list
  method find : string -> Handle.t option
end

type Handle.protocol += Directory of implementation

type t = implementation

let make impl = Directory (impl :> implementation)

let from handle = Handle.into handle (function Directory impl -> Some impl | _ -> None)

let list i = Handle.invoke i (fun o -> o#list)

let find i name = Handle.invoke i (fun o -> o#find name)