libp2p/stream/bufferstream

    Dark Mode
Search:
Group by:
  Source   Edit

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