Currently, support for public suffix handling is implemented as providing a builder-style CookieStore::with_suffix_list. This is probably fine; in cases where e.g. a user wants to use a cache (psl crate), they may do so outside of user_agent and use the builder method.
For the case of de/serializing a CookieStore, however, should we indicate/enforce that a stored CookieStore previously utilized a public suffix list? That is, they create a CookieStore and specify a public suffix list, and serialize it to disk. Should we then enforce that the deserialization of that CookieStore must be accompanied by a public suffix list again?
Rather than store the provided public suffix list, I think it would make more sense to simply indicate whether the serialized store had a list (bool flag), and change load() to take an Option<publicsuffix::List>. If the deserialized store's list flag is true, and the provided Option<_> is None, return an error.
Currently, support for public suffix handling is implemented as providing a builder-style
CookieStore::with_suffix_list. This is probably fine; in cases where e.g. a user wants to use a cache (pslcrate), they may do so outside ofuser_agentand use the builder method.For the case of de/serializing a
CookieStore, however, should we indicate/enforce that a storedCookieStorepreviously utilized a public suffix list? That is, they create aCookieStoreand specify a public suffix list, and serialize it to disk. Should we then enforce that the deserialization of thatCookieStoremust be accompanied by a public suffix list again?Rather than store the provided public suffix list, I think it would make more sense to simply indicate whether the serialized store had a list (bool flag), and change
load()to take anOption<publicsuffix::List>. If the deserialized store's list flag is true, and the providedOption<_>isNone, return an error.