encode(to:) Encodes the history token into the provided encoder. Declarationfunc encode(to encoder: any Encoder) throws