nim-libp2p/libp2p/stream.nim

52 lines
1.3 KiB
Nim
Raw Normal View History

2019-08-27 21:45:21 +00:00
## Nim-LibP2P
## Copyright (c) 2018 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 chronos
type LPStream* = ref object of RootObj
closed*: bool
method read*(s: LPStream, n = -1): Future[seq[byte]]
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method readExactly*(s: LPStream, pbytes: pointer, nbytes: int): Future[void]
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method readLine*(s: LPStream, limit = 0, sep = "\r\n"): Future[string]
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method readOnce*(s: LPStream, pbytes: pointer, nbytes: int): Future[int]
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method readUntil*(s: LPStream,
pbytes: pointer, nbytes: int,
sep: seq[byte]): Future[int]
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method write*(s: LPStream, pbytes: pointer, nbytes: int)
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method write*(s: LPStream, msg: string, msglen = -1)
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method write*(s: LPStream, msg: seq[byte], msglen = -1)
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard
method close*(s: LPStream)
2019-08-30 15:28:07 +00:00
{.base, async, gcsafe.} =
2019-08-27 21:45:21 +00:00
discard