mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-18 11:30:04 +00:00
28 lines
805 B
Swift
28 lines
805 B
Swift
import Foundation
|
|
|
|
enum ValueBoxKeyType: Int32 {
|
|
case binary
|
|
case int64
|
|
}
|
|
|
|
struct ValueBoxTable {
|
|
let id: Int32
|
|
let keyType: ValueBoxKeyType
|
|
}
|
|
|
|
protocol ValueBox {
|
|
func begin()
|
|
func commit()
|
|
|
|
func beginStats()
|
|
func endStats()
|
|
|
|
func range(_ table: ValueBoxTable, start: ValueBoxKey, end: ValueBoxKey, values: (ValueBoxKey, ReadBuffer) -> Bool, limit: Int)
|
|
func range(_ table: ValueBoxTable, start: ValueBoxKey, end: ValueBoxKey, keys: (ValueBoxKey) -> Bool, limit: Int)
|
|
func get(_ table: ValueBoxTable, key: ValueBoxKey) -> ReadBuffer?
|
|
func exists(_ table: ValueBoxTable, key: ValueBoxKey) -> Bool
|
|
func set(_ table: ValueBoxTable, key: ValueBoxKey, value: MemoryBuffer)
|
|
func remove(_ table: ValueBoxTable, key: ValueBoxKey)
|
|
func drop()
|
|
}
|