package wayland

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
class type ['a, 'v, 'role] t = object ... end

An ('a, 'v) t handles incoming messages for a service object of type 'a. This type is used when binding a service, to choose the version. All other handlers get the version from elsewhere (inherited from their parent object).

val interface : [_, _, _] t -> string

interface t is the interface from t's metadata.

val min_version : [_, _, _] t -> int32

min_version t is the minimum version supported by t.

val cast_version : ('a, _, 'role) t -> ('a, _, 'role) t

If the version rules turn out to be too restrictive, this can be used to disable them. Using this incorrectly may lead to a protocol error (such as receiving an event for which no handler was registered).

val accept_new : (_, 'v, [< `Client | `Server ] as 'role) proxy -> int32 -> (module Metadata.S with type t = 'a) -> version:int32 -> ('a, [ `Unknown ], 'role) proxy

accept_new parent id metadata ~version registers a new object, with an ID allocated by the peer. The returned proxy must have its handlers attached before switching threads, since otherwise processing a message addressed to the new object will fail. This is called from the generated code; the user code then calls the result.

val attach_proxy : ('a, [ `Unknown ], 'role) proxy -> ['a, [> `V1 ] as 'v, 'role] t -> ('a, 'v, 'role) proxy

attach_proxy p t sets t as the handler for p, which must be a partly initialised proxy returned by accept_new. It returns the proxy with its version cast to the handler's version.

val attach : ('a, [ `Unknown ], 'role) proxy -> ['a, [> `V1 ], 'role] t -> unit

Like attach_proxy, but ignores the resulting proxy. Useful if the object only needs to respond to messages from the peer.

OCaml

Innovation. Community. Security.