Skip to main content

encode_message_with_limit

Function encode_message_with_limit 

Source
pub fn encode_message_with_limit(
    msg: &Message,
    max_message_len: u16,
) -> Result<BytesMut, EncodeError>
Expand description

Encode a BGP message with a custom maximum message length.

Same as encode_message but uses max_message_len for UPDATE size validation (RFC 8654 Extended Messages).

§Errors

Returns an EncodeError if the message exceeds the negotiated maximum or a field value is out of range.