MessageEncoder

io.github.pidoveproject.showdown.protocol.MessageEncoder
See theMessageEncoder companion object
trait MessageEncoder[-A]

A message encoder.

Type parameters

A

the type to serialize

Attributes

Companion
object
Source
MessageEncoder.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def encode(value: A): Either[ProtocolError, List[String]]

Encode a value.

Encode a value.

Value parameters

value

the value to encode

Attributes

Returns

either an error or the result as a list of arguments

Source
MessageEncoder.scala

Concrete methods

def contramap[B](f: B => A): MessageEncoder[B]

Map the input of this encoder.

Map the input of this encoder.

Type parameters

B

the new type to serialize

Value parameters

f

the function to apply to the input value

Attributes

Returns

a new encoder

Source
MessageEncoder.scala
def zip[B](other: => MessageEncoder[B]): MessageEncoder[(A, B)]

Zip this encoder with another one/

Zip this encoder with another one/

Type parameters

B

the type to zip with A

Value parameters

other

the encoder to zip with

Attributes

Returns

an encoder taking a tuple (A, B) and concatenating the results

Source
MessageEncoder.scala