object Fs2DataSource
Provides helpers for creating FS2 streams of io.dylemma.spac.json.JsonEvent
,
using fs2-data-json as the underlying event provider.
This helper is set up to mirror the layout of the corresponding Fs2DataSource helper in the fs2-data-xml support module,
but since there's less customization involved in setting up a stream of fs2-data-json Token objects,
there's a lot less going on in this object. The main functionality provided here is the convert
pipe,
and some small helpers to automatically call it.
For example:
val charStream: Stream[IO, Char] = ??? // this... val jsonStream1: Stream[IO, JsonEvent] = { import fs2.data.json._ charStream .through(tokens) .through(Fs2DataSource.convertEvents) } // could be replaced with val jsonStream2: Stream[IO, JsonEvent] = { Fs2DataSource[IO](charStream) }
Essentially this helper just provides a convenient apply
method that accepts
String
, Stream[F, Char]
, Stream[F, String]
, or Stream[F, fs2.data.json.Token]
to return a Stream[F, JsonEvent]
which a JsonParser
could then interact with.
- Source
- Fs2DataSource.scala
- Alphabetic
- By Inheritance
- Fs2DataSource
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def convert[F[_]](implicit callerPos: CallerPos): Pipe[F, Token, JsonEvent]
Pipe for converting
fs2.data.json.Token
toio.dylemma.spac.json.JsonEvent
.Pipe for converting
fs2.data.json.Token
toio.dylemma.spac.json.JsonEvent
. This will be used under the hood of theapply
andsyncIO
helpers, but is being made available to allow for manual stream creation when desired. This pipe takes care of injecting "inferred" events that don't have explicit token representations, like FieldEnd, IndexStart, and IndexEnd. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromRawJsonStream[F[_], A](rawJsonStream: Stream[F, A])(implicit A: CharLikeChunks[F, A], F: RaiseThrowable[F], callerPos: CallerPos): Stream[F, JsonEvent]
- def fromString[F[_]](rawJson: String)(implicit F: RaiseThrowable[F], callerPos: CallerPos): Stream[F, JsonEvent]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()