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: [], tags: [].}
  Source   Edit
proc new(T: typedesc[BufferStream]; timeout: Duration = DefaultConnectionTimeout): T:type {.
    ...raises: [].}
  Source   Edit
func shortLog(s: BufferStream): auto {....raises: [], tags: [].}
  Source   Edit

Methods

method atEof(s: BufferStream): bool {....raises: [], tags: [].}
  Source   Edit
method closeImpl(s: BufferStream): Future[void] {....raises: [], tags: [RootEffect].}
close the stream and clear the buffer   Source   Edit
method initStream(s: BufferStream) {....raises: [], tags: [RootEffect, TimeEffect].}
  Source   Edit
method pushData(s: BufferStream; data: seq[byte]): Future[void] {.base,
    stackTrace: false, ...gcsafe, raises: [], raises: [], raises: [],
    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: [], raises: [], raises: [], tags: [RootEffect].}
  Source   Edit
method readOnce(s: BufferStream; pbytes: pointer; nbytes: int): Future[int] {.
    stackTrace: false, ...gcsafe, raises: [], raises: [], raises: [],
    tags: [RootEffect].}
  Source   Edit

Templates

template formatItIMPL(it: BufferStream): auto
  Source   Edit

Exports

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