Webs_session.StateState descriptors.
FIXME. encode allow errors ? pp ? Ideally this would simply take a typegist.
The type for describing session state of type 'a. Values of this type describe to session handlers how codec values of type 'a with bytes and assert them for equality.
val make :
encode:('a -> string) ->
decode:(string -> ('a, string) Stdlib.result) ->
equal:('a -> 'a -> bool) ->
unit ->
'a tmake ~encode ~decode ~equal () tests state for equality with eq, encodes states to bytes with encode, decodes states from bytes with decode and tests state for equality with equal
val encode : 'a t -> 'a -> stringencode sd is the encoding function of sd.
val decode : 'a t -> string -> ('a, string) Stdlib.resultdecode sd is the decoding function of sd.
val equal : 'a t -> 'a -> 'a -> boolequal sd is the equality function of sd.