Skip to main content

encode_value_with

Function encode_value_with 

Source
pub fn encode_value_with(
    value: &str,
    dialect: Dialect,
) -> Result<String, EncodeError>
Expand description

Encode an exact standalone value under an explicit literal dialect.

The returned token is verified in both A=<token>\n and A=<token>. The canonical A= header consumes two bytes of the first physical line’s byte budget. A Node token may begin with a line break when a first-line cap cannot fit the opening quote; that line break is trivia between = and the value. This is not a context-safe edit or an interpolation guarantee. LF-only raw grammars may require an extra terminal CR as syntax padding; appending CRLF instead of LF requires context-aware native encoding.

§Errors

Returns EncodeError::Unrepresentable when no exact spelling is available.