2022-05-19 19:56:03 +00:00
|
|
|
## Nim-Codex
|
2022-03-21 18:09:59 +00:00
|
|
|
## Copyright (c) 2022 Status Research & Development GmbH
|
|
|
|
## Licensed under either of
|
|
|
|
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
|
|
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
|
|
## at your option.
|
|
|
|
## This file may not be copied, modified, or distributed except according to
|
|
|
|
## those terms.
|
|
|
|
|
2023-08-01 23:47:57 +00:00
|
|
|
import pkg/libp2p/stream/lpstream
|
2022-03-21 18:09:59 +00:00
|
|
|
import pkg/chronos
|
2023-12-20 02:24:40 +00:00
|
|
|
import pkg/chronicles
|
2022-03-21 18:09:59 +00:00
|
|
|
|
2023-12-20 02:24:40 +00:00
|
|
|
export lpstream, chronos, chronicles
|
2022-03-21 18:09:59 +00:00
|
|
|
|
|
|
|
logScope:
|
2022-05-19 19:56:03 +00:00
|
|
|
topics = "codex seekablestream"
|
2022-03-21 18:09:59 +00:00
|
|
|
|
|
|
|
type
|
|
|
|
SeekableStream* = ref object of LPStream
|
|
|
|
offset*: int
|
|
|
|
|
2022-06-14 15:19:35 +00:00
|
|
|
method `size`*(self: SeekableStream): int {.base.} =
|
2022-03-21 18:09:59 +00:00
|
|
|
raiseAssert("method unimplemented")
|
|
|
|
|
|
|
|
proc setPos*(self: SeekableStream, pos: int) =
|
|
|
|
self.offset = pos
|