CsvSink

kantan.csv.CsvSink
See theCsvSink companion object

Type class for all types that can be turned into CsvWriter instances.

Instances of CsvSink are rarely used directly. The preferred, idiomatic way is to use the implicit syntax provided by CsvSinkOps, brought in scope by importing kantan.csv.ops._.

See the companion object for default implementations and construction methods.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
CsvSink[S]

Members list

Value members

Abstract methods

def open(s: S): Writer

Opens a Writer on the specified S.

Opens a Writer on the specified S.

Attributes

Concrete methods

def contramap[T](f: T => S): CsvSink[T]

Turns a CsvSink[S] into a CsvSink[T].

Turns a CsvSink[S] into a CsvSink[T].

This allows developers to adapt existing instances of CsvSink rather than write one from scratch.

One could, for example, write CsvSource[File] by basing it on CsvSource[OutputStream]:

 def fileOutput(implicit c: scala.io.Codec): CsvSink[File] =
   CsvSink[OutputStream].contramap(f ⇒ new FileOutputStream(f, c.charSet))

Attributes

def writer[A : HeaderEncoder](s: S, conf: CsvConfiguration)(implicit evidence$1: HeaderEncoder[A], e: WriterEngine): CsvWriter[A]

Opens a CsvWriter on the specified S.

Opens a CsvWriter on the specified S.

Value parameters

conf

CSV writing behaviour.

s

what to open a CsvWriter on.

Attributes

Deprecated methods

def writer[A : HeaderEncoder](s: S, sep: Char, header: String*)(implicit evidence$1: HeaderEncoder[A], e: WriterEngine): CsvWriter[A]

Attributes

Deprecated
true

Inherited methods

def write[A : HeaderEncoder](s: S, rows: IterableOnce[A], conf: CsvConfiguration)(implicit evidence$1: HeaderEncoder[A], e: WriterEngine): Unit

Writes the specified collections directly in the specifie S.

Writes the specified collections directly in the specifie S.

Value parameters

conf

CSV writing behaviour.

rows

CSV data to encode and serialize.

s

where to write the CSV data.

Attributes

Inherited from:
VersionSpecificCsvSink

Deprecated and Inherited methods

def write[A : HeaderEncoder](s: S, rows: IterableOnce[A], sep: Char, header: String*)(implicit evidence$1: HeaderEncoder[A], e: WriterEngine): Unit

Attributes

Deprecated
true
Inherited from:
VersionSpecificCsvSink