Skip to main content

encode_find_value_response

Function encode_find_value_response 

Source
pub fn encode_find_value_response(
    resp: &FindValueResponse,
    ext: Option<&FindValueResponseExt>,
) -> Result<Vec<u8>, Error>
Expand description

Encode a DhtMessage::FindValueResponse with its optional trailing FindValueResponseExt (ADR 013 §Tier 1, two-phase).

Typed per variant rather than taking pre-serialized bytes, so an extension cannot be attached to a message it does not belong to.

§Errors

Propagates a postcard::Error if serialization fails.