xitdb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +28 -0
- data/LICENSE +21 -0
- data/README.md +131 -0
- data/docs/benchmarks.md +135 -0
- data/docs/core.md +123 -0
- data/docs/portable.md +99 -0
- data/docs/releasing.md +37 -0
- data/docs/ruby-profile-v1.md +226 -0
- data/docs/ruby.md +61 -0
- data/examples/indexed_users.rb +23 -0
- data/examples/portable.rb +62 -0
- data/examples/ruby.rb +56 -0
- data/lib/xitdb/context.rb +360 -0
- data/lib/xitdb/conversion.rb +222 -0
- data/lib/xitdb/core/array_list.rb +282 -0
- data/lib/xitdb/core/b_tree.rb +546 -0
- data/lib/xitdb/core/bytes.rb +181 -0
- data/lib/xitdb/core/compaction.rb +172 -0
- data/lib/xitdb/core/crc64.rb +22 -0
- data/lib/xitdb/core/cursor.rb +201 -0
- data/lib/xitdb/core/database.rb +359 -0
- data/lib/xitdb/core/file_store.rb +194 -0
- data/lib/xitdb/core/format.rb +148 -0
- data/lib/xitdb/core/hash_map.rb +371 -0
- data/lib/xitdb/core/hasher.rb +49 -0
- data/lib/xitdb/core/linked_array_list.rb +85 -0
- data/lib/xitdb/core/memory_store.rb +277 -0
- data/lib/xitdb/core/offset_map.rb +85 -0
- data/lib/xitdb/core/replication.rb +242 -0
- data/lib/xitdb/core/sorted_map.rb +361 -0
- data/lib/xitdb/core/transaction.rb +159 -0
- data/lib/xitdb/core.rb +17 -0
- data/lib/xitdb/database.rb +332 -0
- data/lib/xitdb/declarations.rb +73 -0
- data/lib/xitdb/errors.rb +84 -0
- data/lib/xitdb/history.rb +58 -0
- data/lib/xitdb/input_guard.rb +39 -0
- data/lib/xitdb/profiles/portable.rb +407 -0
- data/lib/xitdb/profiles/ruby.rb +173 -0
- data/lib/xitdb/revision.rb +42 -0
- data/lib/xitdb/ruby/codec.rb +123 -0
- data/lib/xitdb/ruby/containers.rb +495 -0
- data/lib/xitdb/ruby/key_encoding.rb +60 -0
- data/lib/xitdb/ruby/ordered_keys.rb +87 -0
- data/lib/xitdb/ruby/scalars.rb +296 -0
- data/lib/xitdb/ruby/wire.rb +146 -0
- data/lib/xitdb/ruby.rb +46 -0
- data/lib/xitdb/snapshot.rb +13 -0
- data/lib/xitdb/streams.rb +148 -0
- data/lib/xitdb/value_walker.rb +192 -0
- data/lib/xitdb/version.rb +5 -0
- data/lib/xitdb/views/array.rb +303 -0
- data/lib/xitdb/views/base.rb +271 -0
- data/lib/xitdb/views/linked_array.rb +18 -0
- data/lib/xitdb/views/map.rb +162 -0
- data/lib/xitdb/views/set.rb +41 -0
- data/lib/xitdb/views/sorted.rb +77 -0
- data/lib/xitdb.rb +20 -0
- data/sig/base.rbs +76 -0
- data/sig/core.rbs +697 -0
- data/sig/manifest.yaml +10 -0
- data/sig/native.rbs +118 -0
- data/sig/public.rbs +427 -0
- data/sig/ruby.rbs +337 -0
- metadata +137 -0
data/sig/native.rbs
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Exact contracts for native methods used to bypass user-defined reflection.
|
|
2
|
+
module XitDB
|
|
3
|
+
interface _NativeClass
|
|
4
|
+
def bind_call: (top) -> Class
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
interface _NativePredicate
|
|
8
|
+
def bind_call: (top, Module) -> bool
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
interface _NativeFrozen
|
|
12
|
+
def bind_call: (top) -> bool
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
interface _NativeFreeze
|
|
16
|
+
def bind_call: [A] (A) -> A
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
interface _NativeMethodNames
|
|
20
|
+
def bind_call: (top, ?bool) -> Array[Symbol]
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
interface _NativeMethod
|
|
24
|
+
def bind_call: [A, B] (Ruby::_Callback[A, B], :call) -> Ruby::_Callback[A, B]
|
|
25
|
+
| (Object, :dig) -> _DigMethod
|
|
26
|
+
| (top, Symbol | String) -> Method
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
interface _NativeModuleName
|
|
30
|
+
def bind_call: (Module) -> String?
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
interface _NativeModuleComparison
|
|
34
|
+
def bind_call: (Module, Module) -> bool?
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
interface _NativeInstanceMethod
|
|
38
|
+
def bind_call: (Module, Symbol | String) -> UnboundMethod
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
interface _NativeIdentity
|
|
42
|
+
def bind_call: (top, top) -> bool
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
interface _NativeObjectId
|
|
46
|
+
def bind_call: (top) -> Integer
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
interface _DigMethod
|
|
50
|
+
def call: (*selector) -> top
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
interface _NativeArrayMap
|
|
54
|
+
def bind_call: [A, B] (Array[A]) { (A) -> B } -> Array[B]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
interface _NativeHashMap
|
|
58
|
+
def bind_call: [K, V, A, B] (Hash[K, V]) { (K, V) -> [ A, B ] } -> Hash[A, B]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
interface _NativeHashKeys
|
|
62
|
+
def bind_call: [K, V] (Hash[K, V]) -> Array[K]
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class Object
|
|
67
|
+
def self.instance_method: (:class) -> XitDB::_NativeClass
|
|
68
|
+
| (:is_a? | :instance_of?) -> XitDB::_NativePredicate
|
|
69
|
+
| (:frozen?) -> XitDB::_NativeFrozen
|
|
70
|
+
| (:freeze) -> XitDB::_NativeFreeze
|
|
71
|
+
| (:singleton_methods | :public_methods | :protected_methods | :private_methods) -> XitDB::_NativeMethodNames
|
|
72
|
+
| (:method | :public_method) -> XitDB::_NativeMethod
|
|
73
|
+
| ...
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
class Module
|
|
77
|
+
def self.instance_method: (:name) -> XitDB::_NativeModuleName
|
|
78
|
+
| (:<=) -> XitDB::_NativeModuleComparison
|
|
79
|
+
| (:instance_method) -> XitDB::_NativeInstanceMethod
|
|
80
|
+
| (:public_instance_methods | :protected_instance_methods | :private_instance_methods) -> XitDB::_NativeMethodNames
|
|
81
|
+
| ...
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
class BasicObject
|
|
85
|
+
def self.instance_method: (:equal?) -> XitDB::_NativeIdentity
|
|
86
|
+
| (:__id__) -> XitDB::_NativeObjectId
|
|
87
|
+
| ...
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
class Array[unchecked out E]
|
|
91
|
+
def self.instance_method: (:map) -> XitDB::_NativeArrayMap
|
|
92
|
+
| ...
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class Hash[unchecked out K, unchecked out V]
|
|
96
|
+
def self.instance_method: (:to_h) -> XitDB::_NativeHashMap
|
|
97
|
+
| (:keys) -> XitDB::_NativeHashKeys
|
|
98
|
+
| ...
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
module XitDB
|
|
102
|
+
class Database
|
|
103
|
+
def self.send: (:open_store, String, readonly: bool) -> [ Core::FileStore, bool ]
|
|
104
|
+
| ...
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
module Core
|
|
108
|
+
class Database
|
|
109
|
+
def send: (:close_unreturned | :restore_empty_target) -> void
|
|
110
|
+
| ...
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
module Store
|
|
114
|
+
def send: (:close_unreturned) -> void
|
|
115
|
+
| ...
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
data/sig/public.rbs
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
module ObjectSpace
|
|
2
|
+
class WeakMap[K, V]
|
|
3
|
+
def initialize: () -> void
|
|
4
|
+
def []: (K) -> V?
|
|
5
|
+
def []=: (K, V) -> V
|
|
6
|
+
def key?: (K) -> bool
|
|
7
|
+
def each_key: () { (K) -> void } -> self
|
|
8
|
+
def each_pair: () { (K, V) -> void } -> self
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
module XitDB
|
|
13
|
+
type selector = String | Integer | Float | Time | Symbol | bool | nil | UInt
|
|
14
|
+
|
|
15
|
+
type path = ::Array[selector]
|
|
16
|
+
|
|
17
|
+
type kind = :map | :sorted_map | :array | :linked_array | :set | :sorted_set
|
|
18
|
+
|
|
19
|
+
type collection_kind = :hash_map | :counted_hash_map | :hash_set | :counted_hash_set | :array_list | :linked_array_list | :sorted_map | :sorted_set
|
|
20
|
+
|
|
21
|
+
type value = selector | Date | DateTime | BigDecimal | Rational | Ruby::EncodedValue | Core::ByteValue | CollectionDeclaration | Views::Base | ::Array[value] | ::Hash[selector, value] | ::Set[selector]
|
|
22
|
+
|
|
23
|
+
type materialized = ::Hash[selector, top] | ::Array[top] | ::Set[selector]
|
|
24
|
+
|
|
25
|
+
type profile = Profiles::Portable | Profiles::Ruby
|
|
26
|
+
|
|
27
|
+
type adapter = Profiles::Portable::Adapter | Ruby::Containers
|
|
28
|
+
|
|
29
|
+
type entry = [ selector, Core::Slot ]
|
|
30
|
+
|
|
31
|
+
type native_visibility_pair = [ :public_instance_methods | :protected_instance_methods | :private_instance_methods, :public_methods | :protected_methods | :private_methods ]
|
|
32
|
+
|
|
33
|
+
type conversion_frame = [ [ Symbol, Integer ], path, Enumerator[entry, adapter], adapter, selector ]
|
|
34
|
+
|
|
35
|
+
type encoding_frame = [ top, path, adapter, Enumerator[[ selector, top ], void], selector ]
|
|
36
|
+
|
|
37
|
+
type materialization_frame = [ [ Symbol, Integer ], path, Enumerator[entry, top], materialized, selector ]
|
|
38
|
+
|
|
39
|
+
type registration = [ path, bool ]
|
|
40
|
+
|
|
41
|
+
type transform = ^(value: top, path: path, role: :key | :value) -> top
|
|
42
|
+
|
|
43
|
+
class UInt
|
|
44
|
+
attr_reader value: Integer
|
|
45
|
+
def initialize: (Integer value) -> void
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class CollectionDeclaration
|
|
49
|
+
KINDS: ::Array[Symbol]
|
|
50
|
+
attr_reader kind: collection_kind
|
|
51
|
+
attr_reader key_kind: (:string | :integer | :float | :time)?
|
|
52
|
+
def initialize: (collection_kind kind, ?key: (:string | :integer | :float | :time)?) -> void
|
|
53
|
+
def counted?: () -> bool
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def self.uint: (Integer) -> UInt
|
|
57
|
+
|
|
58
|
+
def self.bytes: (String, ?format_tag: String?) -> Core::ByteValue
|
|
59
|
+
|
|
60
|
+
def self.map: (?counted: bool) -> CollectionDeclaration
|
|
61
|
+
|
|
62
|
+
def self.set: (?counted: bool) -> CollectionDeclaration
|
|
63
|
+
|
|
64
|
+
def self.array: () -> CollectionDeclaration
|
|
65
|
+
|
|
66
|
+
def self.linked_array: () -> CollectionDeclaration
|
|
67
|
+
|
|
68
|
+
def self.sorted_map: (?key: (:string | :integer | :float | :time)?) -> CollectionDeclaration
|
|
69
|
+
|
|
70
|
+
def self.sorted_set: (?key: (:string | :integer | :float | :time)?) -> CollectionDeclaration
|
|
71
|
+
|
|
72
|
+
class Database
|
|
73
|
+
attr_reader core: Core::Database
|
|
74
|
+
attr_reader profile: profile
|
|
75
|
+
@readonly: bool
|
|
76
|
+
def initialize: (core: Core::Database, profile: profile, ?readonly: bool) -> void
|
|
77
|
+
def self.hasher: (Symbol | Core::Hasher) -> Core::Hasher
|
|
78
|
+
def self.header_hasher: (Core::Header) -> Core::Hasher
|
|
79
|
+
def self.open_store: (String, readonly: bool) -> [ Core::FileStore, bool ]
|
|
80
|
+
def self.open: (String, ?readonly: bool, ?hash: (Symbol | Core::Hasher)?, ?lock_timeout: Float) -> Database
|
|
81
|
+
| [A] (String, ?readonly: bool, ?hash: (Symbol | Core::Hasher)?, ?lock_timeout: Float) { (Database) -> A } -> A
|
|
82
|
+
def self.memory: (?hash: Symbol | Core::Hasher) -> Database
|
|
83
|
+
| [A] (?hash: Symbol | Core::Hasher) { (Database) -> A } -> A
|
|
84
|
+
def transaction: () { (Views::Map) -> void } -> Snapshot
|
|
85
|
+
def perform_transaction: () { (Views::Map) -> void } -> Snapshot
|
|
86
|
+
def snapshot: (?revision: Revision?) -> Snapshot
|
|
87
|
+
def history: () -> History
|
|
88
|
+
def revert: (Snapshot | Revision) -> Snapshot
|
|
89
|
+
def perform_revert: (Snapshot | Revision) -> Snapshot
|
|
90
|
+
def close: () -> void
|
|
91
|
+
def compact: (to: String) -> Database
|
|
92
|
+
def closed?: () -> bool
|
|
93
|
+
def convert: (to: String, profile: :portable | :ruby | profile, ?history: :all | :latest, ?transform: transform?) -> Database
|
|
94
|
+
def conversion_profile: (:portable | :ruby | profile) -> profile
|
|
95
|
+
def copy_history: (Database, Core::FileStore, Core::Cursor, Core::ArrayList, :all | :latest, transform?) -> Core::Cursor
|
|
96
|
+
def history_array: (Core::Cursor) -> Core::ArrayList
|
|
97
|
+
def snapshot_from_history: (Core::Cursor, Integer, ?revision: Revision?) -> Snapshot
|
|
98
|
+
def validate_root: (Core::Slot, Context) -> void
|
|
99
|
+
def snapshot_from_cursor: (Core::Cursor) -> Snapshot
|
|
100
|
+
def revision_for: (Core::Cursor, Integer) -> Revision
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def self.open: (String, ?readonly: bool, ?hash: (Symbol | Core::Hasher)?, ?lock_timeout: Float) -> Database
|
|
104
|
+
| [A] (String, ?readonly: bool, ?hash: (Symbol | Core::Hasher)?, ?lock_timeout: Float) { (Database) -> A } -> A
|
|
105
|
+
|
|
106
|
+
def self.memory: (?hash: Symbol | Core::Hasher) -> Database
|
|
107
|
+
| [A] (?hash: Symbol | Core::Hasher) { (Database) -> A } -> A
|
|
108
|
+
|
|
109
|
+
class Revision
|
|
110
|
+
@file_id: Integer
|
|
111
|
+
@trailer_position: Integer
|
|
112
|
+
@checksum: Integer
|
|
113
|
+
@index: Integer
|
|
114
|
+
def initialize: (file_id: Integer, trailer_position: Integer, checksum: Integer, index: Integer) -> void
|
|
115
|
+
def resolve: (Database) -> Snapshot
|
|
116
|
+
def inspect: () -> String
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
class Snapshot < Views::Map
|
|
120
|
+
attr_reader revision: Revision?
|
|
121
|
+
def initialize: (context: Context, revision: Revision?) -> void
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
class History
|
|
125
|
+
include Enumerable[Snapshot]
|
|
126
|
+
@database: Database
|
|
127
|
+
def initialize: (Database) -> void
|
|
128
|
+
def []: (Integer) -> Snapshot?
|
|
129
|
+
def fetch: (Integer) -> Snapshot
|
|
130
|
+
def size: () -> Integer
|
|
131
|
+
def each: () -> Enumerator[Snapshot, self]
|
|
132
|
+
| () { (Snapshot) -> void } -> self
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
module Streams
|
|
136
|
+
class Handle
|
|
137
|
+
@context: Context
|
|
138
|
+
@active: bool
|
|
139
|
+
def initialize: (Context) -> void
|
|
140
|
+
def expire!: () -> void
|
|
141
|
+
private
|
|
142
|
+
def check!: () -> void
|
|
143
|
+
def integer: (Integer | _ToInt) -> Integer
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
class Reader < Handle
|
|
147
|
+
@source: Core::Bytes::Source
|
|
148
|
+
@size: Integer
|
|
149
|
+
@pos: Integer
|
|
150
|
+
def initialize: (Context, Core::Slot) -> void
|
|
151
|
+
def read: (?Integer? length, ?String? output) -> String?
|
|
152
|
+
def readpartial: (Integer, ?String?) -> String
|
|
153
|
+
def seek: (Integer, ?Integer | :SET | :CUR | :END) -> Integer
|
|
154
|
+
def rewind: () -> Integer
|
|
155
|
+
def pos: () -> Integer
|
|
156
|
+
def size: () -> Integer
|
|
157
|
+
def eof?: () -> bool
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
class Writer < Handle
|
|
161
|
+
@spool: ::File
|
|
162
|
+
def initialize: (Context, ::File) -> void
|
|
163
|
+
def write: (_ToS) -> Integer
|
|
164
|
+
def pos: () -> Integer
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
module InputGuard
|
|
169
|
+
def self.check!: (top, ?path: path) -> void
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
class Context
|
|
173
|
+
class Location
|
|
174
|
+
attr_accessor path: path
|
|
175
|
+
attr_accessor membership: Integer
|
|
176
|
+
attr_accessor expired: bool
|
|
177
|
+
def initialize: (path, Integer, bool) -> void
|
|
178
|
+
def self.new: (path, Integer, bool) -> Location
|
|
179
|
+
end
|
|
180
|
+
attr_reader database: Database
|
|
181
|
+
attr_reader profile: profile
|
|
182
|
+
attr_reader transaction: Core::Transaction?
|
|
183
|
+
attr_reader root: Core::Slot
|
|
184
|
+
attr_reader reference_proof: String?
|
|
185
|
+
@bound: Integer
|
|
186
|
+
@readonly: bool
|
|
187
|
+
@changed: bool
|
|
188
|
+
@locations: ObjectSpace::WeakMap[Location, bool]?
|
|
189
|
+
@streams: ::Array[registration]?
|
|
190
|
+
def initialize: (database: Database, root: Core::Slot, bound: Integer, ?transaction: Core::Transaction?, ?readonly: bool, ?reference_proof: String?) -> void
|
|
191
|
+
def check!: () -> void
|
|
192
|
+
def read: [A] () { () -> A } -> A
|
|
193
|
+
def writable!: () -> void
|
|
194
|
+
def writable_transaction: () -> Core::Transaction
|
|
195
|
+
def collection: (Core::Slot, path: path) -> adapter
|
|
196
|
+
def read_bound: () -> Integer
|
|
197
|
+
def reference_compatible?: (Context) -> bool
|
|
198
|
+
def cursor: (Core::Slot) -> Core::Cursor
|
|
199
|
+
def resolve: (path) -> Core::Slot
|
|
200
|
+
def view: (Core::Slot, path: path, kind: :map) -> Views::Map
|
|
201
|
+
| (Core::Slot, path: path, kind: kind) -> Views::Base
|
|
202
|
+
def changed?: () -> bool
|
|
203
|
+
def copy_from: (Views::Base, at: path, ?transform: transform?) -> top
|
|
204
|
+
def mutate: [A] (path, ?targets: ::Array[path]?, ?positions: Range[Integer?]?) { (Core::Cursor) -> A } -> A
|
|
205
|
+
def register_stream: (path, write: bool) -> registration
|
|
206
|
+
def release_stream: (registration) -> void
|
|
207
|
+
def observe: (path) -> Location?
|
|
208
|
+
def replace_location: (path) -> void
|
|
209
|
+
def invalidate_positions: (path, Integer) -> void
|
|
210
|
+
def change_membership: (path) -> void
|
|
211
|
+
def invalidate_children: (path) -> void
|
|
212
|
+
def check_stream_mutation!: (path, ?targets: ::Array[path]?, ?positions: Range[Integer?]?) -> void
|
|
213
|
+
private
|
|
214
|
+
def mutation_keys: (path, ::Array[path]?, Range[Integer?]?) -> ::Array[path]
|
|
215
|
+
def capture_copy_source: (Views::Base, path) -> [ Context, adapter ]
|
|
216
|
+
def copy_location: (path) -> path
|
|
217
|
+
def copy_array_position: (selector, Integer) -> Integer
|
|
218
|
+
def perform_copy: (Context, adapter, path, path, transform?) -> void
|
|
219
|
+
def assign_copy: (Core::Cursor, Context, adapter, path, path, transform?) -> void
|
|
220
|
+
def refresh_copy_location: (path, path, bool) -> void
|
|
221
|
+
def position_conflict?: (path?, path, Range[Integer?]?) -> bool
|
|
222
|
+
def overlapping_paths?: (path, path) -> bool
|
|
223
|
+
def each_location: (path) { (Location) -> void } -> void
|
|
224
|
+
def path_key: (path) -> path
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
module Views
|
|
228
|
+
class MissingArgument
|
|
229
|
+
def initialize: () -> void
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
class Base
|
|
233
|
+
include Enumerable[top]
|
|
234
|
+
LONG_MAX: Integer
|
|
235
|
+
attr_reader context: Context
|
|
236
|
+
attr_reader path: path
|
|
237
|
+
attr_reader kind: kind
|
|
238
|
+
@location: Context::Location?
|
|
239
|
+
def initialize: (context: Context, path: path, kind: kind) -> void
|
|
240
|
+
def check!: () -> void
|
|
241
|
+
def slot: () -> Core::Slot
|
|
242
|
+
def adapter: () -> adapter
|
|
243
|
+
def size: () -> Integer
|
|
244
|
+
def empty?: () -> bool
|
|
245
|
+
def each: () { (top) -> void } -> self
|
|
246
|
+
| () { (?top, ?top) -> void } -> self
|
|
247
|
+
| () -> Enumerator[top, self]
|
|
248
|
+
def slot_for_assignment: (context: Context, path: path) -> Core::Slot
|
|
249
|
+
def to_ruby: () -> materialized
|
|
250
|
+
def ==: (top) -> bool
|
|
251
|
+
def inspect: () -> String
|
|
252
|
+
def open_bytes: [A] (selector) { (Streams::Reader) -> A } -> A
|
|
253
|
+
def write_bytes: [A] (selector) { (Streams::Writer) -> A } -> A
|
|
254
|
+
def clear_entries?: () -> bool
|
|
255
|
+
def edit: [A] (?targets: ::Array[path]?, ?positions: Range[Integer?]?) { (adapter) -> A } -> void
|
|
256
|
+
def stream_selector: (selector) -> selector
|
|
257
|
+
def stream_mutation: (selector) -> { ?targets: ::Array[path], ?positions: Range[Integer?] }
|
|
258
|
+
def integer_argument: (top) -> Integer
|
|
259
|
+
def normalize_index: (selector) -> Integer
|
|
260
|
+
def validate_growth: (Integer) -> void
|
|
261
|
+
def captured_context: (?readonly: bool) -> Context
|
|
262
|
+
def entry_path: (selector) -> path
|
|
263
|
+
def each_entries: (^() -> Enumerator[entry, adapter], selectors_only: true) { (selector) -> void } -> self
|
|
264
|
+
| (^() -> Enumerator[entry, adapter], ?selectors_only: bool) { (*top) -> void } -> self
|
|
265
|
+
def decode_entry: (selector, Core::Slot, selectors_only: bool) -> ::Array[top]
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
class Map < Base
|
|
269
|
+
UNSET: MissingArgument
|
|
270
|
+
def []: (selector) -> top
|
|
271
|
+
def fetch: (selector, ?top) ?{ (selector) -> top } -> top
|
|
272
|
+
def dig: (*selector) -> top
|
|
273
|
+
def dig_value: (::Array[selector]) -> top
|
|
274
|
+
def key?: (selector) -> bool
|
|
275
|
+
def each_key: () -> Enumerator[selector, self]
|
|
276
|
+
| () { (selector) -> void } -> self
|
|
277
|
+
def each_value: () -> Enumerator[top, self]
|
|
278
|
+
| () { (top) -> void } -> self
|
|
279
|
+
def keys: () -> ::Array[selector]
|
|
280
|
+
def values: () -> ::Array[top]
|
|
281
|
+
def []=: [A] (selector, A) -> A
|
|
282
|
+
def delete: (selector) ?{ (selector) -> top } -> top
|
|
283
|
+
def clear: () -> self
|
|
284
|
+
def merge!: (::Hash[selector, top]) -> self
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
class Array < Base
|
|
288
|
+
UNSET: MissingArgument
|
|
289
|
+
alias length size
|
|
290
|
+
def []: (Integer) -> top
|
|
291
|
+
| (Integer, Integer) -> Slice?
|
|
292
|
+
| (Range[Integer?]) -> Slice?
|
|
293
|
+
| (Integer | Range[Integer?], ?Integer | MissingArgument) -> top
|
|
294
|
+
def read_index: (Integer | Range[Integer?], Integer | MissingArgument | nil) -> top
|
|
295
|
+
def read_range: (Range[Integer?]) -> Slice?
|
|
296
|
+
def fetch: (Integer, ?top) ?{ (Integer) -> top } -> top
|
|
297
|
+
def first: (?Integer | MissingArgument) -> top
|
|
298
|
+
def last: (?Integer | MissingArgument) -> top
|
|
299
|
+
def []=: [A] (Integer, A) -> A
|
|
300
|
+
def <<: (top) -> self
|
|
301
|
+
def push: (*top) -> self
|
|
302
|
+
def insert: (Integer, *top) -> self
|
|
303
|
+
def delete_at: (Integer) -> top
|
|
304
|
+
def pop: (?Integer | MissingArgument) -> top
|
|
305
|
+
def concat: (*::Array[top] | Array) -> self
|
|
306
|
+
def clear: () -> self
|
|
307
|
+
def validate_growth: (Integer) -> void
|
|
308
|
+
def normalize_index: (selector) -> Integer
|
|
309
|
+
def nonnegative_count: (Integer | MissingArgument) -> Integer
|
|
310
|
+
def read_slice: (Integer, Integer) -> Slice?
|
|
311
|
+
def slice_offset: () -> Integer
|
|
312
|
+
def invalidate_positions: (Integer) -> void
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
class Slice < Array
|
|
316
|
+
@offset: Integer
|
|
317
|
+
@count: Integer
|
|
318
|
+
def initialize: (offset: Integer, count: Integer, context: Context, path: path, kind: kind) -> void
|
|
319
|
+
def adapter: () -> Selection
|
|
320
|
+
def slot_for_assignment: (context: Context, path: path) -> Core::Slot
|
|
321
|
+
def slice_offset: () -> Integer
|
|
322
|
+
def entry_path: (Integer) -> path
|
|
323
|
+
class Selection
|
|
324
|
+
@source: adapter
|
|
325
|
+
@offset: Integer
|
|
326
|
+
attr_reader size: Integer
|
|
327
|
+
def initialize: (adapter, Integer, Integer) -> void
|
|
328
|
+
def kind: () -> kind
|
|
329
|
+
def lookup: (Integer) -> Core::Slot?
|
|
330
|
+
def each_entry: () -> Enumerator[entry, self]
|
|
331
|
+
| () { (selector, Core::Slot) -> void } -> self
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
class LinkedArray < Array
|
|
336
|
+
def split: (Integer) -> [ Slice?, Slice? ]
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
class Set < Base
|
|
340
|
+
def include?: (selector) -> bool
|
|
341
|
+
def add: (selector) -> self
|
|
342
|
+
def delete: (selector) -> self
|
|
343
|
+
def clear: () -> self
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
module Sorted : Base
|
|
347
|
+
def rank: (selector) -> Integer
|
|
348
|
+
|
|
349
|
+
def from: (selector) -> Enumerator[top, self]
|
|
350
|
+
| (selector) { (*top) -> void } -> self
|
|
351
|
+
|
|
352
|
+
def from_index: (Integer) -> Enumerator[top, self]
|
|
353
|
+
| (Integer) { (*top) -> void } -> self
|
|
354
|
+
|
|
355
|
+
def page: (offset: Integer, limit: Integer) -> Enumerator[top, self]
|
|
356
|
+
| (offset: Integer, limit: Integer) { (*top) -> void } -> self
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
class SortedMap < Map
|
|
360
|
+
include Sorted
|
|
361
|
+
def merge!: (::Hash[selector, top]) -> self
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
class SortedSet < Set
|
|
365
|
+
include Sorted
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
module ValueWalker
|
|
370
|
+
def self.encode: (top, context: Context, path: path) -> Core::Slot
|
|
371
|
+
|
|
372
|
+
def self.materialize: (Views::Base) -> materialized
|
|
373
|
+
|
|
374
|
+
def self.insert: (materialization_frame, top) -> void
|
|
375
|
+
|
|
376
|
+
def self.begin_encoding: (top, path, Context, ::Hash[Integer, bool], ::Array[encoding_frame]) -> Core::Slot?
|
|
377
|
+
|
|
378
|
+
def self.encode_view: (Views::Base, Context, path) -> Core::Slot
|
|
379
|
+
|
|
380
|
+
def self.encode_scalar: (top, Context, path) -> Core::Slot
|
|
381
|
+
|
|
382
|
+
def self.assign_encoding_parent: (::Array[encoding_frame], Core::Slot) -> void
|
|
383
|
+
|
|
384
|
+
def self.finish_encoding: (encoding_frame, ::Hash[Integer, bool], ::Array[encoding_frame]) -> Core::Slot
|
|
385
|
+
|
|
386
|
+
def self.next_input: (encoding_frame) -> [ selector, top ]?
|
|
387
|
+
|
|
388
|
+
def self.begin_materialization: (Core::Slot, path, (adapter | Views::Slice::Selection)?, Context, ::Hash[[ Symbol, Integer ], bool], ::Array[materialization_frame]) -> void
|
|
389
|
+
|
|
390
|
+
def self.next_stored_entry: (materialization_frame) -> entry?
|
|
391
|
+
|
|
392
|
+
def self.materialized_child: (materialization_frame, entry) -> [ Core::Slot, path ]?
|
|
393
|
+
|
|
394
|
+
def self.finish_materialization: (materialization_frame, ::Hash[[ Symbol, Integer ], bool], ::Array[materialization_frame]) -> materialized
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
class Conversion
|
|
398
|
+
@source: Context
|
|
399
|
+
@destination: Context
|
|
400
|
+
@transform: transform?
|
|
401
|
+
def initialize: (Context, Context, ?transform: transform?) -> void
|
|
402
|
+
def copy: (Core::Slot, ?path: path, ?adapter: adapter?) -> Core::Slot
|
|
403
|
+
private
|
|
404
|
+
def begin_value: (Core::Slot, path, adapter?, ::Array[conversion_frame], ::Hash[[ Symbol, Integer ], bool]) -> Core::Slot?
|
|
405
|
+
def copy_scalar: (Core::Slot, path) -> Core::Slot
|
|
406
|
+
def assign_parent: (::Array[conversion_frame], Core::Slot) -> void
|
|
407
|
+
def finish_frame: (conversion_frame, ::Array[conversion_frame], ::Hash[[ Symbol, Integer ], bool]) -> Core::Slot
|
|
408
|
+
def next_entry: (conversion_frame) -> entry?
|
|
409
|
+
def select_child: (conversion_frame, entry) -> [ Core::Slot, path ]?
|
|
410
|
+
def transform: (top, path, :key | :value) -> top
|
|
411
|
+
def transform_key: (selector, path) -> selector
|
|
412
|
+
class ByteSource
|
|
413
|
+
@source: Core::Bytes::Source
|
|
414
|
+
@start: Integer
|
|
415
|
+
attr_reader size: Integer
|
|
416
|
+
attr_reader format_tag: String?
|
|
417
|
+
def initialize: (Context, Core::Slot) -> void
|
|
418
|
+
def read: (Integer, Integer) -> String
|
|
419
|
+
def unsigned: (Integer) -> [ Integer, Integer ]
|
|
420
|
+
def slice: (Integer, Integer) -> ByteSource
|
|
421
|
+
def portable_encoding: () -> Encoding
|
|
422
|
+
def write_to: (Context, ?prefix: String, ?format_tag: String?) -> Core::Slot
|
|
423
|
+
private
|
|
424
|
+
def each_chunk: () { (String) -> void } -> void
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
end
|