nim-dagger/codex/streams/seekablestream.nim

28 lines
712 B
Nim
Raw Normal View History

2022-05-19 19:56:03 +00:00
## Nim-Codex
## 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.
import pkg/libp2p/stream/lpstream
import pkg/chronos
import pkg/chronicles
export lpstream, chronos, chronicles
logScope:
2022-05-19 19:56:03 +00:00
topics = "codex seekablestream"
type
SeekableStream* = ref object of LPStream
offset*: int
method `size`*(self: SeekableStream): int {.base.} =
raiseAssert("method unimplemented")
proc setPos*(self: SeekableStream, pos: int) =
self.offset = pos