from linklist import quicly_linklist_t from maxsender import quicly_maxsender_t from recvstate import quicly_recvstate_t, quicly_recvstate_transfer_complete from sendstate import quicly_sendstate_t, quicly_sendstate_is_open const QUICLY_ERROR_FREE_CONNECTION* = 0xff03 type quicly_stream_id_t* {.importc, header: "quicly/constants.h", bycopy.} = int64 quicly_conn_t* {.bycopy, header: "quicly/constants.h", incompleteStruct.} = object # quicly.h definitions moved here to resolve recursive dependency quicly_stream_callbacks_t* {.importc, header: "quicly.h", bycopy.} = object on_destroy*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.} on_send_shift*: proc(stream: ptr quicly_stream_t, delta: csize_t) {.cdecl.} on_send_emit*: proc(stream: ptr quicly_stream_t, off: csize_t, dst: pointer, len: csize_t, wrote_all: cint) {.cdecl.} on_send_stop*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.} on_receive*: proc(stream: ptr quicly_stream_t, off: csize_t, src: pointer, len: csize_t) {.cdecl.} on_receive_reset*: proc(stream: ptr quicly_stream_t, err: cint) {.cdecl.} quicly_sender_state_t* {.importc, header: "quicly.h", bycopy.} = enum QUICLY_SENDER_STATE_NONE, QUICLY_SENDER_STATE_SEND, QUICLY_SENDER_STATE_UNACKED, QUICLY_SENDER_STATE_ACKED, StreamSendError* {.importc, header: "quicly.h", bycopy.} = object sender_state*: quicly_sender_state_t error_code: uint16 StreamSendPendingLink* {.importc, header: "quicly.h", bycopy.} = object control*: quicly_linklist_t default_scheduler*: quicly_linklist_t StreamSendAux* {.importc, header: "quicly.h", bycopy.} = object max_stream_data*: uint64 stop_sending*: StreamSendError reset_stream*: StreamSendError max_stream_data_sender*: quicly_maxsender_t blocked*: quicly_sender_state_t pending_link*: StreamSendPendingLink StreamRecvAux* {.importc, header: "quicly.h", bycopy.} = object window*: uint32 max_ranges*: uint32 quicly_stream_t* {.importc, header: "quicly.h", bycopy.} = object conn*: ptr quicly_conn_t stream_id*: quicly_stream_id_t callbacks*: ptr quicly_stream_callbacks_t sendstate*: quicly_sendstate_t recvstate*: quicly_recvstate_t data*: pointer streams_blocked* {.bitsize: 1.}: cuint send_aux*: StreamSendAux recv_aux*: StreamRecvAux