2023-10-12 20:12:39 +02:00
|
|
|
|
|
|
|
import cython
|
|
|
|
|
2023-11-16 19:24:50 +01:00
|
|
|
from ..connection cimport APIConnection
|
|
|
|
|
2023-10-12 20:12:39 +02:00
|
|
|
|
2023-10-13 03:17:46 +02:00
|
|
|
cdef bint TYPE_CHECKING
|
|
|
|
|
2023-10-12 20:12:39 +02:00
|
|
|
cdef class APIFrameHelper:
|
|
|
|
|
|
|
|
cdef object _loop
|
2023-11-16 19:24:50 +01:00
|
|
|
cdef APIConnection _connection
|
2023-10-12 20:12:39 +02:00
|
|
|
cdef object _transport
|
|
|
|
cdef public object _writer
|
|
|
|
cdef public object _ready_future
|
2023-10-13 03:17:46 +02:00
|
|
|
cdef bytes _buffer
|
2023-11-16 19:24:50 +01:00
|
|
|
cdef unsigned int _buffer_len
|
|
|
|
cdef unsigned int _pos
|
2023-10-12 20:12:39 +02:00
|
|
|
cdef object _client_info
|
|
|
|
cdef str _log_name
|
|
|
|
cdef object _debug_enabled
|
|
|
|
|
2023-11-17 20:11:36 +01:00
|
|
|
cpdef set_log_name(self, str log_name)
|
|
|
|
|
2023-11-16 19:24:50 +01:00
|
|
|
@cython.locals(original_pos="unsigned int", new_pos="unsigned int")
|
2023-10-13 03:17:46 +02:00
|
|
|
cdef bytes _read_exactly(self, int length)
|
|
|
|
|
2023-11-17 00:50:54 +01:00
|
|
|
@cython.locals(bytes_data=bytes)
|
|
|
|
cdef _add_to_buffer(self, object data)
|
2023-10-13 03:17:46 +02:00
|
|
|
|
2023-11-16 19:24:50 +01:00
|
|
|
@cython.locals(end_of_frame_pos="unsigned int")
|
2023-10-20 02:00:36 +02:00
|
|
|
cdef _remove_from_buffer(self)
|
2023-11-16 17:31:02 +01:00
|
|
|
|
|
|
|
cpdef write_packets(self, list packets)
|