Attempt to create a protobuf accessor: Right(ProtoAccessor[A, B])
.
Attempt to create a protobuf accessor: Right(ProtoAccessor[A, B])
. If an error is encountered
Left will contain the error message.
type of GeneratedMessage
from which data should be extracted.
type of data to be extracted from A
.
the path string
an instance of deaktator.pops.msgs.ProtoOps to help with accessor function creation.
a caster that takes the untyped value returned by the PB reflection APIs and provides a typesafe value.
an accessor on the right or an error message on the left.
Attempt to create a protobuf accessor: Some(ProtoAccessor[A, B])
.
Attempt to create a protobuf accessor: Some(ProtoAccessor[A, B])
. If an error is encountered
None is returned. This doesn't provide diagnostic information like ProtoAccessor.either does.
type of GeneratedMessage
from which data should be extracted.
type of data to be extracted from A
.
the path string
an instance of deaktator.pops.msgs.ProtoOps to help with accessor function creation.
a caster that takes the untyped value returned by the PB reflection APIs and provides a typesafe value.
an accessor or None if an error is encountered.
Contains
either
andoption
factory methods to produce ProtoAccessor from string-based paths. Note that conversions can be called explicitly or can be used implicitly. In the following examples,Score
's definition can be found at aloha-proto/Scores.proto.If error information isn't important, use the Option-based API:
An attempt is made to fully respect types so the following won't work because "error.model.id" is represented by a
Long
in the protobuf definition:Additionally, Option and non-Option based accessors are respected. If a non-
required
path element is found in the path, and the accessor doesn't return an Option, an error will be returned: