libp2p/stream/bufferstream

    Dark Mode
Search:
Group by:
  Source   Edit

Nim-LibP2P Copyright (c) 2019 Status Research & Development GmbH

Licensed under either of

at your option. This file may not be copied, modified, or distributed except according to those terms.

Types

BufferStream = ref object of Connection
  readQueue*: AsyncQueue[seq[byte]]
  readBuf*: StreamSeq
  pushing*: bool
  reading*: bool
  pushedEof*: bool
  returnedEof*: bool
  Source   Edit

Consts

BufferStreamTrackerName = "BufferStream"
  Source   Edit

Procs

proc len(s: BufferStream): int {....raises: [Defect], tags: [].}
  Source   Edit
proc new(T: typedesc[BufferStream]; timeout: Duration = DefaultConnectionTimeout): T:type {.
    ...raises: [Defect].}
  Source   Edit
func shortLog(s: BufferStream): auto {....raises: [Defect], tags: [].}
  Source   Edit

Methods

method atEof(s: BufferStream): bool {....raises: [Defect], raises: [Defect],
                                      tags: [].}
  Source   Edit
method closeImpl(s: BufferStream): Future[void] {....raises: [Defect],
    tags: [RootEffect].}
close the stream and clear the buffer   Source   Edit
method initStream(s: BufferStream) {....raises: [Defect],
                                     tags: [TimeEffect, RootEffect].}
  Source   Edit
method pushData(s: BufferStream; data: seq[byte]): Future[void] {.base,
    stackTrace: false, ...gcsafe, raises: [Defect], tags: [RootEffect].}

Write bytes to internal read buffer, use this to fill up the buffer with data.

pushTo will block if the queue is full, thus maintaining backpressure.

  Source   Edit
method pushEof(s: BufferStream): Future[void] {.base, stackTrace: false, ...gcsafe,
    raises: [Defect], tags: [RootEffect].}
  Source   Edit
method readOnce(s: BufferStream; pbytes: pointer; nbytes: int): Future[int] {.
    stackTrace: false, ...gcsafe, raises: [Defect], tags: [RootEffect].}
  Source   Edit

Templates

template formatItIMPL(it: BufferStream): auto
  Source   Edit

Exports

newLPStreamWriteError, getProtoHeader, ProtoHeader, shortLog, init, random, $, MaError, ephemeral, MaPatternOp, HTTP, initVBuffer, getProtoHeader, decode, ==, decodeProposal, getLen, ECDHEScheme, shortLog, init, closed, finish, [], shcopy, shuffle, random, init, Secret, peekVarint, random, $, validate, mapOr, maxInlineKeyLength, TranscoderDNS, QUIC, init, ephemeral, getRequiredField, getField, write, public, MAKind, getBytes, write, init, getField, checkFieldNumber, getRepeatedField, matchPartial, getBytes, len, ==, readLp, initVBuffer, VBuffer, atEof, LPStreamTrackerName, newLPStreamIncorrectDefect, update, payloadType, <=, LPStreamError, init, IP, protoAddress, decode, newRng, DefaultConnectionTimeout, checkValid, getPublicKey, WebSockets, extractPublicKey, mapAnd, new, hash, newLPStreamEOFError, init, ==, DNSADDR, hash, key, write, WSS, LPStream, verify, writePacked, isUpgraded, init, closeImpl, readSeq, toBytes, shortLog, encode, TranscoderIP4, protoName, ==, toRawBytes, TranscoderIP6Zone, $, initProtoBuffer, newLPStreamReadError, match, writeLPVarint, CryptoResult, ProtoResult, WebRTCDirect, init, DNSANY, UDP, PeerInfo, TranscoderOnion, StreamTracker, write, init, isEmpty, writeArray, writeLp, LPStreamIncompleteError, [], LPStreamEOFError, IP6, shortLog, initVBuffer, ProtoFlags, PKScheme, finish, payload, stretchKeys, Connection, write, init, TCP, PrivateKey, getBytes, write, init, &=, PeerInfoError, newLPStreamClosedError, close, $, initProtoBuffer, toException, DNS, init, readVarint, upgrade, goffset, >, KeyPair, init, high, toString, cmp, init, SupportedWireTypes, formatItIMPL, formatItIMPL, formatItIMPL, Signature, hash, formatItIMPL, toBytes, DigestSheme, IPFS, getField, readOnce, init, init, isEmpty, ProtoScalar, shortLog, LPStreamIncorrectDefect, hex, protocols, init, HTTPS, tryAndWarn, LPError, getPtr, write, sign, encode, supported, MaResult, init, ProtoField, toBytes, writeSeq, init, &, DNS6, IpTransportProtocol, toOpenArray, init, allFuturesThrowing, IP4, TranscoderPort, isEnough, peekSeq, getField, createExchange, >=, init, payloadDomain, $, MaPattern, init, LPStreamLimitError, SignedPayload, TimeoutHandler, toBytes, newLPStreamLimitError, write, mac, keyOpenArray, match, decode, $, isEmpty, LPStreamReadError, getRequiredRepeatedField, init, newLPStreamIncompleteError, newLPStreamReadError, initProtoBuffer, MAProtocol, getPackedRepeatedField, initStream, contains, readVarint, getField, shortLog, DNS4, MultiAddress, readArray, selectBest, write, Envelope, hasPublicKey, toException, init, isEnough, init, Reliable, hex, ProtoBuffer, closeImpl, write, MaxSizeError, WS, init, encode, init, init, match, getField, <, iv, onUpgrade, readLine, Eof, CryptoError, getField, append, peekArray, UNIX, PeerRecord, init, SupportedSchemes, getRepeatedField, LPStreamWriteError, getField, MaxMessageSize, Unreliable, SupportedSchemesInt, random, checkFutures, macOpenArray, validate, protoCode, mapEq, getField, libp2p_pki_schemes, concat, TranscoderP2P, AddressInfo, ConnectionTrackerName, TranscoderIP6, new, init, write, EnvelopeError, encode, len, RsaDefaultKeySize, PeerId, createProposal, MaPatResult, Direction, InvalidVarintError, shortLog, init, write, getBytes, write, init, UTP, init, PublicKey, writeLp, getRawBytes, writePBVarint, ProtoFieldKind, readExactly, protoArgument, getRepeatedField, ProtoError, init, initStream, ivOpenArray, closeWithEOF, orError, vsizeof, decodeExchange, getField, MaInvalidAddress, LPStreamClosedError, writeVarint, items, write, getOrder, TranscoderUnix, SignedPeerRecord, join