do_encode_word

Function do_encode_word 

Source
pub fn do_encode_word<'a, 'b: 'a>(
    word: &'a Word,
    handle: &'a mut EncodingWriter<'b>,
    ecw_ctx: Option<EncodedWordContext>,
) -> Result<(), EncodingError>
Expand description

As word has to be differently encoded, depending on the context it appears in it cannot implement EncodableInHeader, instead we have a function which can be used by type containing it which (should) implement EncodableInHeader

If ecw_ctx is None the word can not be encoded as a “encoded-word”, if it is Some(context) the context represents in which context the word does appear, which changes some properties of the encoded word.

NOTE: != encoded-word, through it might create an encoded-word