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

Templates

template formatItIMPL(it: BufferStream): auto
  Source   Edit

Exports

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