Skip to main content

decode_async

Function decode_async 

Source
pub async fn decode_async<'de, T, R, C>(
    config: C,
    reader: R,
) -> Result<T, DecodeError>
where T: Deserialize<'de>, R: AsyncRead + Unpin, C: Config,
Available on crate features async-fiber and serde only.
Expand description

Attempt to decode a given serde-compatible type T from the given async reader safely using a non-blocking fiber.

Requires the async-fiber and serde features.

ยงErrors

Returns a DecodeError if the reader fails or the data is invalid.