types§
The types
package contains a set of case classes used by Janus for various
common tasks, like referencing data or declaring operation results.
Built-in Types§
.from§
.from = { dynamic, get, attribute, varying, app, self, subject, vm }
The types.from
cases are used to declaratively reference data needed for a computation.
They are used by from
, though you can replace them with your own using
from@build
.
The default meaning of each type is documented under from#{x}
.
.result§
.result = { init, pending, progress, success, failure }
.result.complete >: { success, failure }
The types.result
cases are used to communicate the overall result of an operation:
not done, done with success, or done with failure.
complete
is a virtual case superclass that will matchsuccess
orfailure
.
The Reference
Attribute uses types.result
to determine whether to .set
a Request
result onto the Model
or not. The
caching Resolvers do something similar.
.validity§
.validity = { valid, warning, error }
The types.validity
cases are used by Model
and its
validate
schema declaration to determine the validity of
the Model.
In particular, they are used to determine the results of the Model validation
methods like #errors
and #valid
.
.operation§
.operation = { read, create, update, delete }
.operation.mutate >: { create, update, delete }
The types.operation
cases are used by Request
and the MemoryCache
Resolver to help manage the cache state. Their particular
semantics are documented extensively under the MemoryCache
documentation.
The
mutate
virtual superclass will match any ofcreate
,update
, ordelete
.
If you are not using the MemoryCache
, there is no real reason to use these cases.
.traversal§
.traversal = { recurse, delegate, defer, varying, value, nothing }
The types.traversal
cases are used to control the flow of Traversal
.
You can find information about them at the API documentation linked above. They are also explained in more extensive detail in the Traversal Further Reading chapter.