encoding_uses_base_empty_state

Macro encoding_uses_base_empty_state 

Source
macro_rules! encoding_uses_base_empty_state {
    (
        $encoding:ty
        $(, with generics ($($impl_generics:tt)*))?
        $(, with where clause ($($where_clause:tt)*))?
    ) => { ... };
}
Expand description

Generates implementations of ForOverwrite and EmptyState for the given encoding that always defer to the base implementation of the trait.

This is suitable for any encoding that won’t need to implement those traits for any un-owned types. To implement encodings for types that are not owned for your crate (such as types in std or a third-party crate that bilrost doesn’t already cover) your implementation will be required to “own” the trait that is being implemented. This means that for your custom encoding type MyEncoding, the traits ForOverwrite<MyEncoding> and EmptyState<MyEncoding> can still be implemented inside your crate as long as you don’t also use this macro.