You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
Sometimes it is not desirable to generate a method for a variant of an enum. Presently, there is no way to skip over some specific element. I think we should add a per-element attribute that tells a given derive to skip that element. For example:
structMyType;#[derive(EnumToGetters,EnumAsGetters)]enumMyEnum{#[enum_as_getters(skip)]Foo(i32),// EnumAsGetters will return a reference to this; we we override `as_foo()` below#[enum_to_getters(skip)]Bar(MyType),// MyType is not `Clone`, so EnumToGetters would fail to compile on this}implMyEnum{pubfnas_foo(&self) -> i32{iflet&MyEnum::Foo(i) = self{*i
}else{panic!( ... )}}}
Sometimes it is not desirable to generate a method for a variant of an enum. Presently, there is no way to skip over some specific element. I think we should add a per-element attribute that tells a given derive to skip that element. For example:
This is also similar to how Serde works.