struct Pf::Kit::HybridArray(T, N)

Included Modules

Defined in:

permafrost/kit/hybrid_array.cr

Constant Summary

INITIAL_SPILL_CAPACITY = 8

Constructors

Instance Method Summary

Instance methods inherited from module Enumerable(T)

to_pf_bidi to_pf_bidi, to_pf_map(& : T -> Tuple(K, V)) : Pf::Map(K, V) forall K, V
to_pf_map
to_pf_map
, to_pf_set : Pf::Set(T) to_pf_set, to_pf_uset32 : Pf::USet32 to_pf_uset32

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def <<(object : T) : Nil #

[View source]
def clear : Nil #

[View source]
def each(& : T -> ) #
Description copied from module Indexable(T)

Calls the given block once for each element in self, passing that element as a parameter.

a = ["a", "b", "c"]
a.each { |x| print x, " -- " }

produces:

a -- b -- c --

[View source]
def inspect(io) #

[View source]
def pop #

[View source]
def pop? : T | Nil #

[View source]
def pretty_print(pp) : Nil #

[View source]
def push(object : T) : Nil #

[View source]
def size : Int32 #
Description copied from module Indexable(T)

Returns the number of elements in this container.


[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]
def top? : T | Nil #

Provides fast access to the top of the stack.


[View source]
def unsafe_fetch(index : Int) : T #
Description copied from module Indexable(T)

Returns the element at the given index, without doing any bounds check.

Indexable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they access elements with #[](index) and #[]?(index).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.


[View source]
def unsafe_put(index : Int, value : T) : Nil #
Description copied from module Indexable::Mutable(T)

Sets the element at the given index to value, without doing any bounds check.

Indexable::Mutable makes sure to invoke this method with index in 0...size, so converting negative indices to positive ones is not needed here.

Clients never invoke this method directly. Instead, they modify elements with #[]=(index, value).

This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.


[View source]
def unsafe_set(object : T) #

[View source]
def unsafe_top : T #

[View source]