Skip to content
scalive
Menu
ConnectingLiveReconnectingOffline
c

RootedFormCodec

class RootedFormCodec[Owner, A]

A form codec carrying the phantom type of the FormRoot that owns it.

Owner has no runtime representation. It prevents codecs from different root values from being combined accidentally while delegating decoding to an underlying FormCodec.

Type parameters

Owner

the singleton type of the owning root

A

the decoded value type

Defined by scalive.RootedFormCodec. View source (scalive/api/src/scalive/forms/FormDefinition.scala:278-299)

Methods3

emap

def emap[B](f: A => Either[FormErrors, B]): RootedFormCodec[Owner, B]

Validates or transforms a successful value while preserving this codec's owner.

f is not run when the underlying decoder fails.

Defined by scalive.RootedFormCodec.emap. View source (scalive/api/src/scalive/forms/FormDefinition.scala:290-291)

map

def map[B](f: A => B): RootedFormCodec[Owner, B]

Maps successful decoded values without changing ownership or validation errors.

Defined by scalive.RootedFormCodec.map. View source (scalive/api/src/scalive/forms/FormDefinition.scala:283-284)

zip

def zip[B](that: RootedFormCodec[Owner, B]): RootedFormCodec[Owner, (A, B)]

Combines this codec with another codec owned by the same root.

Both decoders run against the same FormData. When both fail, the left errors precede the right errors.

Defined by scalive.RootedFormCodec.zip. View source (scalive/api/src/scalive/forms/FormDefinition.scala:298-299)