Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

MutableQueue.ts overview

Since v2.0.0


Exports Grouped by Category


constructors

bounded

Creates a new bounded MutableQueue.

Signature

declare const bounded: <A>(capacity: number) => MutableQueue<A>

Source

Since v2.0.0

unbounded

Creates a new unbounded MutableQueue.

Signature

declare const unbounded: <A>() => MutableQueue<A>

Source

Since v2.0.0

getters

capacity

The maximum number of elements that a queue can hold.

Note: unbounded queues can still implement this interface with capacity = Infinity.

Signature

declare const capacity: <A>(self: MutableQueue<A>) => number

Source

Since v2.0.0

isEmpty

Returns true if the queue is empty, false otherwise.

Signature

declare const isEmpty: <A>(self: MutableQueue<A>) => boolean

Source

Since v2.0.0

isFull

Returns true if the queue is full, false otherwise.

Signature

declare const isFull: <A>(self: MutableQueue<A>) => boolean

Source

Since v2.0.0

length

Returns the current number of elements in the queue.

Signature

declare const length: <A>(self: MutableQueue<A>) => number

Source

Since v2.0.0

model

MutableQueue (interface)

Signature

export interface MutableQueue<out A> extends Iterable<A>, Pipeable, Inspectable {
  readonly [TypeId]: TypeId

  /** @internal */
  queue: MutableList.MutableList<A>
  /** @internal */
  capacity: number | undefined
}

Source

Since v2.0.0

symbol

EmptyMutableQueue

Signature

declare const EmptyMutableQueue: unique symbol

Source

Since v2.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v2.0.0

utils

MutableQueue (namespace)

Source

Since v2.0.0

Empty (type alias)

Signature

type Empty = typeof EmptyMutableQueue

Source

Since v2.0.0

offer

Offers an element to the queue.

Returns whether the enqueue was successful or not.

Signature

declare const offer: {
  <A>(self: MutableQueue<A>, value: A): boolean
  <A>(value: A): (self: MutableQueue<A>) => boolean
}

Source

Since v2.0.0

offerAll

Enqueues a collection of values into the queue.

Returns a Chunk of the values that were not able to be enqueued.

Signature

declare const offerAll: {
  <A>(values: Iterable<A>): (self: MutableQueue<A>) => Chunk.Chunk<A>
  <A>(self: MutableQueue<A>, values: Iterable<A>): Chunk.Chunk<A>
}

Source

Since v2.0.0

poll

Dequeues an element from the queue.

Returns either an element from the queue, or the def param.

Note: if there is no meaningful default for your type, you can always use poll(MutableQueue.EmptyMutableQueue).

Signature

declare const poll: { <D>(def: D): <A>(self: MutableQueue<A>) => D | A; <A, D>(self: MutableQueue<A>, def: D): A | D }

Source

Since v2.0.0

pollUpTo

Dequeues up to n elements from the queue.

Returns a List of up to n elements.

Signature

declare const pollUpTo: {
  (n: number): <A>(self: MutableQueue<A>) => Chunk.Chunk<A>
  <A>(self: MutableQueue<A>, n: number): Chunk.Chunk<A>
}

Source

Since v2.0.0