XjUddlmZddlmZmZddlmZddlmZm Z m Z m Z ddl m Z ddlmZdd lmZdd lmZe d Ze d d Ze dd ZGdde eeeZGdde eeeZGddeeeeZGddeeZGddeeZGddeeeeeeZGddeeZGdd eeZGd!d"eeZee ezZ!d#e"d$<ee ezZ#d#e"d%<ee ezZ$d#e"d&<ee ezZ%d#e"d'<ee ezZ&d#e"d(<ee ezZ'd#e"d)<Gd*d+e eeeZ(Gd,d-e ee.Z)Gd/d0e.Z*e)e e*zZ+d#e"d1<y2)3) annotations)ABCMetaabstractmethod)Callable)AnyGeneric TypeAliasTypeVar) EndOfStream)TypedAttributeProvider) AsyncResource) TaskGroupT_ItemT_coT) covariantT_contra) contravariantc2eZdZdZddZddZeddZy)UnreliableObjectReceiveStreama3 An interface for receiving objects. This interface makes no guarantees that the received messages arrive in the order in which they were sent, or that no messages are missed. Asynchronously iterating over objects of this type will yield objects matching the given type parameter. c|SNselfs f/mnt/ssd/data/Dropbox/adrian/vault-secondbrain/venv/lib/python3.12/site-packages/anyio/abc/_streams.py __aiter__z'UnreliableObjectReceiveStream.__aiter__ chK |jd{S7#t$rtdwxYwwrreceiver StopAsyncIterationrs r __anext__z'UnreliableObjectReceiveStream.__anext__!3 /' '' /$$ . / 22/2c Kyw)aa Receive the next item. :raises ~anyio.ClosedResourceError: if the receive stream has been explicitly closed :raises ~anyio.EndOfStream: if this stream has been closed from the other end :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable due to external causes Nrrs rr#z%UnreliableObjectReceiveStream.receive'N)returnz#UnreliableObjectReceiveStream[T_co])r+r__name__ __module__ __qualname____doc__rr%rr#rr rrrs%/     r rc"eZdZdZeddZy)UnreliableObjectSendStreamz An interface for sending objects. This interface makes no guarantees that the messages sent will reach the recipient(s) in the same order in which they were sent, or at all. c Kyw)a4 Send an item to the peer(s). :param item: the item to send :raises ~anyio.ClosedResourceError: if the send stream has been explicitly closed :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable due to external causes Nrritems rsendzUnreliableObjectSendStream.send>r)r*N)r5rr+Noner-r.r/r0rr6rr rr2r24s    r r2ceZdZdZy)UnreliableObjectStreamzs A bidirectional message stream which does not guarantee the order or reliability of message delivery. Nr-r.r/r0rr rr:r:Ksr r:ceZdZdZy)ObjectReceiveStreamz A receive message stream which guarantees that messages are received in the same order in which they were sent, and that no messages are missed. Nr;rr rr=r=Tr r=ceZdZdZy)ObjectSendStreamz A send message stream which guarantees that messages are delivered in the same order in which they were sent, without missing any messages in the middle. Nr;rr rr@r@[r>r r@c"eZdZdZeddZy) ObjectStreamzl A bidirectional message stream which guarantees the order and reliability of message delivery. c Kywz Send an end-of-file indication to the peer. You should not try to send any further data to this stream after calling this method. This method is idempotent (does nothing on successive calls). Nrrs rsend_eofzObjectStream.send_eoflr)r*Nr+r7r-r.r/r0rrErr rrBrBbs    r rBc4eZdZdZddZddZedd dZy) ByteReceiveStreamz An interface for receiving bytes from a single peer. Iterating this byte stream will yield a byte string of arbitrary length, but no more than 65536 bytes. c|Srrrs rrzByteReceiveStream.__aiter__~rr chK |jd{S7#t$rtdwxYwwrr"rs rr%zByteReceiveStream.__anext__r&r'c Kyw)a Receive at most ``max_bytes`` bytes from the peer. .. note:: Implementers of this interface should not return an empty :class:`bytes` object, and users should ignore them. :param max_bytes: maximum number of bytes to receive (must be a positive integer) :return: the received bytes :raises ValueError: if ``max_bytes`` is less than 1 :raises ~anyio.EndOfStream: if this stream has been closed from the other end Nr)r max_bytess rr#zByteReceiveStream.receiver)r*N)r+rI)r+bytes)i)rMintr+rNr,rr rrIrIvs%/     r rIc"eZdZdZeddZy)ByteSendStreamz0An interface for sending bytes to a single peer.c Kyw)z[ Send the given bytes to the peer. :param item: the bytes to send Nrr4s rr6zByteSendStream.sendr)r*N)r5rNr+r7r8rr rrQrQs:  r rQc"eZdZdZeddZy) ByteStreamzA bidirectional byte stream.c KywrDrrs rrEzByteStream.send_eofr)r*NrFrGrr rrTrTs&  r rTr AnyUnreliableByteReceiveStreamAnyUnreliableByteSendStreamAnyUnreliableByteStreamAnyByteReceiveStreamAnyByteSendStream AnyByteStreamc0eZdZdZe d ddZy)ListenerzBAn interface for objects that let you accept incoming connections.Nc Kyw)af Accept incoming connections as they come in and start tasks to handle them. :param handler: a callable that will be used to handle each accepted connection :param task_group: the task group that will be used to start tasks for handling each accepted connection (if omitted, an ad-hoc task group will be created) Nr)rhandler task_groups rservezListener.server)r*r)r_zCallable[[T_co], Any]r`zTaskGroup | Noner+r7)r-r.r/r0rrarr rr]r]s2LMQ  ,  :J      r r]ceZdZeddZy)ObjectStreamConnectablec Kyw)z Connect to the remote endpoint. :return: an object stream connected to the remote end :raises ConnectionFailed: if the connection fails Nrrs rconnectzObjectStreamConnectable.connectr)r*N)r+zObjectStream[T_co]r-r.r/rrerr rrcrc  r rc) metaclassceZdZeddZy)ByteStreamConnectablec Kyw)z Connect to the remote endpoint. :return: a bytestream connected to the remote end :raises ConnectionFailed: if the connection fails Nrrs rrezByteStreamConnectable.connectr)r*N)r+rTrfrr rrjrjrgr rjAnyByteStreamConnectableN), __future__rabcrrcollections.abcrtypingrrr r _core._exceptionsr _core._typedattrr _resourcesr_tasksrrrrrr2r:r=r@rBrIrQrTrNrV__annotations__rWrXrYrZr[r]rcrjrlrr rrvs"'$33+5%  v& :T 2   DM="8  F  H}&< .!&)+Ef+M7=1(; V6" ( '= B  ]$:    "N  "%(+<<  u%6Y&