struct

Pylon::Core::Changes

Inherits Indexable < Enumerable < Iterable < Struct < Value < Object

Constructors

[](*changes : Change) : Changes
Source
flatten(reconciled : Indexable(Change)) : Changes
Source
new(*, initial_capacity : Int32)
Source

Instance methods

+(other : Changes) : Changes
Source
<<(change : Change) : self
Source
batch(offset : Int32, count : Int32) : Changes
Source
case_colliding_delete_indexes
Source
clear
Source
each(*, within range : Range, & : Change -> ) : Nil

Calls the given block once for all elements at indices within the given range, passing each element as a parameter.

Raises IndexError if the starting index is out of range.

array = ["a", "b", "c", "d", "e"]
array.each(within: 1..3) { |x| print x, " -- " }

produces:

b -- c -- d --
Source
ordered_for_writing(deferred : Set(Bytes)) : Changes
Source
size

Returns the number of elements in this container.

Source
subtract_case_collision_digests(holds : Set(Bytes)) : Nil
Source
unsafe_fetch(index : Int) : Change

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.

Source