docs/generated/contracts.mdgenerated from code

Reference · 1 min read

wire-decode

Contracts: wire-decode.

Source: crates/lvcs-net/src/wire/mod.rs.

ruston main
1/// Decode one envelope.2///3/// It does not check the signature ([`verify`]) or the kind: a kind4/// outside the `wire_kind` set ([`known_kind`] is `None`) is ignored by the5/// receiver, never rejected (discussion:owner/588).6///7/// # Errors8///9/// [`WireError::TooLarge`] past `WIRE_MAX_BYTES` before anything is10/// decoded, [`WireError::UnknownMajor`] when its major version is not11/// `WIRE_MAJOR` (read first, whatever the rest holds), and12/// [`WireError::Malformed`] for anything else that is not a canonical CBOR13/// envelope.14pub fn decode(bytes: &[u8]) -> Result<Envelope, WireError> {