trait Source[+A] extends AnyRef
A Source[A]
is like an Iterable[A]
but with a built-in assumption that the iterator may be closeable,
intended for use as a convenient argument to a Parser
's parse
method.
The spac core library avoids depending on Cats-Effect and FS2 (to avoid introducing "dependency hell"
situations for projects that must depend on pre-3.0 versions of those projects), so this class acts as
a stand-in for both cats.effect.Resource
and fs2.Stream
for non-async usage.
- A
Type of item emitted by Iterators from this Source
- Source
- Source.scala
- Alphabetic
- By Inheritance
- Source
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract def open(): (Iterator[A], () => Unit)
Opens a new iterator from this source, returning a tuple containing the iterator and a function that must eventually be called to release any resources associated with the iterator.
Opens a new iterator from this source, returning a tuple containing the iterator and a function that must eventually be called to release any resources associated with the iterator.
- returns
A tuple containing an iterator and a close function
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Source[A], B)
- 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 ensuring(cond: (Source[A]) => Boolean, msg: => Any): Source[A]
- def ensuring(cond: (Source[A]) => Boolean): Source[A]
- def ensuring(cond: Boolean, msg: => Any): Source[A]
- def ensuring(cond: Boolean): Source[A]
- 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 formatted(fmtstr: String): String
- 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
- def iterateWith[B](f: (Iterator[A]) => B): B
Lender pattern that opens a new iterator from this source, passes it to the given consumer function
f
, returns the result off
, then closes the iterator.Lender pattern that opens a new iterator from this source, passes it to the given consumer function
f
, returns the result off
, then closes the iterator.- B
The consumer function's output type
- f
A function to consume the iterator provided by this source
- returns
The result generated by passing a new Iterator from this source to the consumer function
f
- 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()
Deprecated Value Members
- def →[B](y: B): (Source[A], B)
- Implicit
- This member is added by an implicit conversion from Source[A] toArrowAssoc[Source[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.