All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.message.UnknownMessage.scala Maven / Gradle / Ivy

The newest version!
// Copyright (c) 2018-2021 by Rob Norris
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT

package skunk.net.message

import scodec.Decoder
import scodec.bits.ByteVector
import scodec.codecs.bytes

/** Default interpretation of a backend message if the tag is unknown to Skunk. */
final case class UnknownMessage(tag: Byte, data: ByteVector) extends BackendMessage {
  override def toString = s"UnknownMessage(${tag.toChar}, $data)"
}

object UnknownMessage {
  def decoder(tag: Byte): Decoder[UnknownMessage] = bytes.map(bv => UnknownMessage(tag, bv))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy