diff --git a/.documentation/Actors.html b/.documentation/Actors.html new file mode 100644 index 0000000..dc4d947 --- /dev/null +++ b/.documentation/Actors.html @@ -0,0 +1,189 @@ + + + + Actors Reference + + + + + + + + + + + + + +
+
+

Docs (99% documented)

+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+

Actors

+

The following actors are available globally.

+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    A async sequence that wraps a single value and emits a new element whenever the element changes.

    +
    let sequence = CurrentElementAsyncSequence(0)
    +print(await sequence.element)
    +
    +await stream.yield(1)
    +print(await sequence.element)
    +
    +await stream.yield(2)
    +await stream.yield(3)
    +await stream.yield(4)
    +print(await sequence.element)
    +
    +// Prints:
    +// 0
    +// 1
    +// 4
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public actor CurrentElementAsyncSequence<Element> : AsyncSequence
    + +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + diff --git a/.documentation/Actors/CurrentElementAsyncSequence.html b/.documentation/Actors/CurrentElementAsyncSequence.html new file mode 100644 index 0000000..f1dc02d --- /dev/null +++ b/.documentation/Actors/CurrentElementAsyncSequence.html @@ -0,0 +1,437 @@ + + + + CurrentElementAsyncSequence Actor Reference + + + + + + + + + + + + + +
+
+

Docs (99% documented)

+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+

CurrentElementAsyncSequence

+
+
+ +
public actor CurrentElementAsyncSequence<Element> : AsyncSequence
+ +
+
+

A async sequence that wraps a single value and emits a new element whenever the element changes.

+
let sequence = CurrentElementAsyncSequence(0)
+print(await sequence.element)
+
+await stream.yield(1)
+print(await sequence.element)
+
+await stream.yield(2)
+await stream.yield(3)
+await stream.yield(4)
+print(await sequence.element)
+
+// Prints:
+// 0
+// 1
+// 4
+
+ +
+
+
+
    +
  • +
    + + + + element + +
    +
    +
    +
    +
    +
    +

    The element wrapped by this async sequence, emitted as a new element whenever it changes.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var element: Element { get }
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

Initialization +

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates an async sequence that emits elements only after a specified time interval elapses between emissions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ element: Element)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + element + + +
    +

    The async sequence in which this sequence receives it’s elements.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

AsyncSequence +

+
+
+
    +
  • +
    + + + + makeAsyncIterator() + +
    +
    +
    +
    +
    +
    +

    Creates an async iterator that emits elements of this async sequence.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    nonisolated public func makeAsyncIterator() -> AsyncStream<Element>.Iterator
    + +
    +
    +
    +

    Return Value

    +

    An instance that conforms to AsyncIteratorProtocol.

    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

API +

+
+
+
    +
  • +
    + + + + yield(_:) + +
    +
    +
    +
    +
    +
    +

    Yield a new element to the sequence.

    + +

    Yielding a new element will update this async sequence’s element property +along with emitting it through the sequence.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func yield(_ element: Element)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + element + + +
    +

    The element to yield.

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + finish() + +
    +
    +
    +
    +
    +
    +

    Mark the sequence as finished by having it’s iterator emit nil.

    + +

    Once finished, any calls to yield will result in no change.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func finish()
    + +
    +
    +
    +
    +
  • +
  • +
    + + + + finish(with:) + +
    +
    +
    +
    +
    +
    +

    Emit one last element beford marking the sequence as finished by having it’s iterator emit nil.

    + +

    Once finished, any calls to yield will result in no change.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func finish(with element: Element)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + element + + +
    +

    The element to emit.

    +
    +
    +
    +
    +
    +
  • +
+
+
+
+ +
+
+ + diff --git a/.documentation/Extensions.html b/.documentation/Extensions.html index e520367..d43f433 100644 --- a/.documentation/Extensions.html +++ b/.documentation/Extensions.html @@ -35,6 +35,14 @@