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

io.github.methrat0n.restruct.handlers.bson.ComplexBsonFormaterInterpreter.scala Maven / Gradle / Ivy

The newest version!
package io.github.methrat0n.restruct.handlers.bson

import io.github.methrat0n.restruct.core.data.schema.ComplexSchemaAlgebra
import io.github.methrat0n.restruct.readers.bson.bsonReader
import io.github.methrat0n.restruct.writers.bson.bsonWriter

trait ComplexBsonFormaterInterpreter extends ComplexSchemaAlgebra[BsonHandler] {

  private[this] val reader = bsonReader
  private[this] val writer = bsonWriter

  override def many[T](schema: BsonHandler[T]): BsonHandler[List[T]] =
    BsonHandler(
      reader.many(schema).read,
      writer.many(schema).write
    )

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy