Writer

info.fingo.spata.io.Writer
See theWriter companion trait
object Writer

Utility to write external data from a stream of characters. It is used through one of its inner classes:

The writing functions in Writer.Shifting use fs2-io library.

In every case, the caller of function taking resource (java.io.OutputStream) as a parameter is responsible for its cleanup.

Functions writing binary data (to java.io.InputStream or taking java.nio.file.Path) use given scala.io.Codec to encode data. If not provided, the default JVM charset is used.

For data encoded to UTF, the byte order mark (BOM) is not added to the output.

All of above applies not only to write functions but also to apply, which internally make use of write.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Writer.type

Members list

Type members

Classlikes

object CSV

Given instances to witness that given type is supported by Writer as CSV destination.

Given instances to witness that given type is supported by Writer as CSV destination.

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
CSV.type
sealed trait CSV[-A]

Representation of CSV data destination, used to witness that certain sources may be used by write operations.

Representation of CSV data destination, used to witness that certain sources may be used by write operations.

Attributes

See also

CSV object.

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object outputStreamWitness.type
object pathWitness.type
final class Plain[F[_]] extends Writer[F]

Writer which executes I/O operations on current thread, without context (thread) shifting.

Writer which executes I/O operations on current thread, without context (thread) shifting.

Type parameters

F

the effect type, with type class providing support for delayed execution (typically cats.effect.IO) and logging (provided internally by spata)

Attributes

Supertypes
trait Writer[F]
class Object
trait Matchable
class Any
final class Shifting[F[_]] extends Writer[F]

Writer which shifts I/O operations to a thread pool provided for blocking operations. Uses the built-in internal blocking thread pool.

Writer which shifts I/O operations to a thread pool provided for blocking operations. Uses the built-in internal blocking thread pool.

Type parameters

F

the effect type, with type classes providing support for suspended execution (typically cats.effect.IO), Async execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).

Attributes

Supertypes
trait Writer[F]
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_] : Logger]: Shifting[F]

Alias for shifting.

Alias for shifting.

Type parameters

F

the effect type, with type classes providing support for suspended execution (typically cats.effect.IO), Async execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).

Attributes

Returns

Writer with support for thread shifting

def plain[F[_] : Logger]: Plain[F]

Provides basic writer executing I/O on current thread.

Provides basic writer executing I/O on current thread.

Type parameters

F

the effect type, with type class providing support for delayed execution (typically cats.effect.IO) and logging (provided internally by spata)

Attributes

Returns

basic Writer

def shifting[F[_] : Logger]: Shifting[F]

Provides writer with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool and default chunks size.

Provides writer with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool and default chunks size.

Type parameters

F

the effect type, with type classes providing support for suspended execution (typically cats.effect.IO), Async execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).

Attributes

Returns

Writer with support for thread shifting