Skip to main content

decode_async_with_context

Function decode_async_with_context 

Source
pub async fn decode_async_with_context<'de, T, R, C, Context>(
    config: C,
    reader: R,
    context: Context,
) -> 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 using a non-blocking fiber and a context.

Requires the async-fiber and serde features.

ยงErrors

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