io.github.methrat0n.restruct.handlers.bson.ComplexBsonFormaterInterpreter.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of restruct-bson-handler_2.12 Show documentation
Show all versions of restruct-bson-handler_2.12 Show documentation
Obtains any format from your class in just one line
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