Skip to main content

read_message

Function read_message 

Source
pub async fn read_message<R: AsyncRead + Unpin>(
    reader: &mut R,
) -> Result<MinerMessage>
Expand description

Read a length-prefixed JSON message from an async reader.

Wire format: 4-byte big-endian length prefix followed by JSON payload. Returns an error if the message exceeds MAX_MESSAGE_SIZE.