MCPcopy Create free account
hub / github.com/Lymia/enumset / new

Method new

enumset_derive/src/plan.rs:166–195  ·  view source on GitHub ↗
(input: &DeriveInput, attrs: &EnumsetAttrs)

Source from the content-addressed store, hash-verified

164}
165impl EnumSetInfo {
166 fn new(input: &DeriveInput, attrs: &EnumsetAttrs) -> EnumSetInfo {
167 EnumSetInfo {
168 name: input.ident.clone(),
169 crate_name: attrs
170 .crate_name
171 .as_ref()
172 .map(|x| Ident::new(x, Span::call_site())),
173 explicit_integer_repr: None,
174 explicit_array_repr: false,
175 explicit_serde_repr: None,
176 variants: Vec::new(),
177 vis: input.vis.clone(),
178 explicit_enum_repr: None,
179 min_discriminant: 0,
180 max_discriminant: 0,
181 max_variant_bit: 0,
182 max_variant_span: None,
183 cur_discrim: 0,
184 used_variant_names: HashSet::new(),
185 used_discriminants: HashSet::new(),
186 lsb_encoding: false,
187 msb_encoding: None,
188 mask_encoding: false,
189 compact_encoding: false,
190 no_ops: attrs.no_ops,
191 no_super_impls: attrs.no_super_impls,
192 serialize_deny_unknown: attrs.serialize_deny_unknown,
193 warnings: vec![],
194 }
195 }
196
197 /// Explicits sets the serde representation of the enumset from a string.
198 fn push_serialize_repr(&mut self, span: Span, ty: &str) -> syn::Result<()> {

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected