Module Kms.Property

A property can be used to read or write extra settings on an object (resource).

type id = [ `Property ] Id.t

Properties have numeric IDs and names. Only the names are standarised.

type raw_value = Unsigned.UInt64.t
module Info : sig ... end

Metadata describing properies.

type ('obj, 'value) t

A ('obj, 'value) t is a property on objects of type 'obj with values of type 'value.

val create : read:(Info.t -> raw_value -> 'v) -> write:(Info.t -> 'v -> raw_value) -> string -> (_, 'v) t

create ~read ~write name defines a new property.

This is useful if you need a property that isn't pre-defined.

val create_bool : string -> (_, bool) t

create_bool name is a property whose value is 0 or 1/non-zero for true.

val create_int : string -> (_, int) t
val create_fixed : string -> (_, Ufixed.t) t
val create_id : string -> (_, _ Id.t) t

create_id name is a property whose value is an object ID.

val create_id_opt : string -> (_, _ Id.t option) t

create_id_opt name is a property whose value is an optional ID.

val create_enum : string -> (string * ([> `Unknown of raw_value ] as 'a)) list -> (_, 'a) t

create_enum name values exposes an enum property using an OCaml variant type.

module Map : Stdlib.Map.S with type key = id