Skip to main content

Module io

Module io 

Source
Expand description

Yog Data over a byte stream — a socket, a pipe: each message a frame, its length (a little-endian u32) and then its binary form. What Yog’s programs say to each other (the game’s control channel, yog serve).

Constants§

MAX_FRAME
The longest frame read: anything longer is a broken or hostile peer.

Functions§

read_frame
The next message; None where the stream ends between frames.
read_frame_bytes
The next frame’s bytes; None where the stream ends between frames.
write_frame
Writes message as one frame, and flushes.
write_frame_bytes
Writes bytes (a message’s binary form) as one frame, and flushes.

Type Aliases§

Len
How a frame’s length is written.