libp2p/stream/bufferstream

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

Methods

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

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) {.base, async, ...raises: [], tags: [], forbids: [].}
Source   Edit  
method readOnce(s: BufferStream; pbytes: pointer; nbytes: int): Future[int] {.
    async, ...raises: [], tags: [RootEffect], forbids: [].}
Source   Edit  

Templates

template formatItIMPL(it: BufferStream): auto
Source   Edit  

Exports

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