iyi

Standard library, 0.18.0

std/bit_array

Compact array data structure storing bits as booleans.

import std/bit_array to use it. Source: src/std/bit_array.iyi at v0.18.0.

Internally stored as 64-bit unsigned integers. Zero external C library dependencies.

BitArrayalias

std/bit_arrayiyi doc src/std/bit_array.iyi
pub alias BitArray = ::BitArray

BitArraystruct, reopened

std/bit_arrayiyi doc src/std/bit_array.iyi
struct ::BitArray
  def ==(other : BitArray) : Bool
  def ==(other : Object) : Bool
  def [](index : Int) : Bool
  def []=(index : Int, value : Bool) : Bool
  def []?(index : Int) : Bool | ::Nil
  def all? : Bool
  def any? : Bool
  def clone : self
  def count(item : Bool) : Int32
  def count : Int32
  def dup : self
  def each(& : (Bool -> Nil)) : Nil
  def each_with_index(offset : Int = 0, & : (Bool, Int32 -> Nil)) : Nil
  def empty? : Bool
  def fill(value : Bool, start : Int, count : Int) : self
  def fill(value : Bool) : self
  def first : Bool
  def first? : Bool | ::Nil
  def hash : Int32
  def includes?(obj : Bool) : Bool
  def index(obj : Bool, offset : Int = 0) : Int32 | ::Nil
  def initialize(size : Int, initial : Bool = false)
  def inspect(io : IyiIO) : Nil
  def inspect : String
  def invert : Nil
  def last : Bool
  def last? : Bool | ::Nil
  def self.new(size : Int, & : (Int32 -> _)) : self
  def none? : Bool
  def one? : Bool
  def reverse_in_place : self
  def rindex(obj : Bool, offset : Int = @size - 1) : Int32 | ::Nil
  def rotate_in_place(n : Int = 1) : self
  def size : Int32
  def to_s(io : IyiIO) : Nil
  # Into one builder: a string grown by a character per bit copied it per
  # bit, and 200,000 bits took 46 s to print.
  def to_s : String
  def to_slice : Std::Slice::Bytes
  def toggle(index : Int) : Nil
  def unsafe_fetch(index : Int) : Bool
  def unsafe_put(index : Int, value : Bool) : Bool
end