Conn
struct ConnImplements Movable
- Fields
stream: Streamclosed: Bool: The peer hung up, or the connection failed.
__init__
def __init__(out self, var stream: Stream) fd
def fd(self) -> c_int read_available
def read_available(mut self, limit: Int = Int(0)) Reads what's waiting on the socket into the input buffer: all of it, or with limit, about that many bytes, leaving the rest in the socket, where poll still reports it.
next_frame
def next_frame(mut self) -> Optional[Frame] The next complete frame in the input buffer, if there is one.
send
def send(mut self, kind: UInt8, object_id: UInt64, task_id: UInt64, payload: Span[UInt8]) Queues a frame and sends as much as the socket takes now.
flush
def flush(mut self) Sends queued output until the socket would block.
wants_write
def wants_write(self) -> Bool unsent
def unsent(self) -> Int Bytes queued to send that the peer hasn't taken yet.