syn 2 upgrade. All of the changes are Breaking, and so have not been highlighted as such.
DeriveInputExt::append_derives
parameters changed fromNestedMeta
tosyn::Path
.DeriveInputExt::tag_parameter
return type changed fromNestedMeta
toMeta
.DeriveInputExt::tag_parameters
return type changed fromNestedMeta
toMeta
.util::nested_meta_to_path
is removed.util::meta_list_contains
is removed.- Removed
util::namespace_meta_lists
-- useutil::namespace_nested_metas_iter
. - Replaced
util::namespace_meta_lists_iter
withutil::namespace_nested_metas_iter
. - Replaced
util::tag_meta_lists_iter
withutil::tag_nested_metas_iter
. - Removed
util::tag_meta_lists_owned_iter
, there is no borrowed version because ofsyn
's new API, so useutil::tag_nested_metas_iter
. - Removed
util::ident_concat
-- users can usequote::format_ident!
instead. - Added
util::namespace_parameter
andutil::namespace_parameters
.
util::namespace_parameter
returns anOption<NestedMeta>
.util::namespace_parameters
returns aVec<NestedMeta>
.- Breaking:
util::namespace_meta_lists_iter
returns animpl Iterator<Item = MetaList>
. - Breaking:
util::tag_meta_list
renamed toutil::tag_meta_lists_iter
. - Breaking:
util::tag_meta_list_owned
renamed toutil::tag_meta_lists_owned_iter
. - Breaking:
util::tag_meta_lists_owned_iter
takes inimpl Iterator<Item = MetaList>
instead ofVec<MetaList>
.
util::contains_tag
supports checking if any list of attributes contains a#[namespace(tag)]
.DeriveInputExt::contains_tag
supports checking if a type contains a#[namespace(tag)]
.- Added
FieldsExt::is_unit/is_named/is_tuple
which returns abool
for the relevantFields
type. FieldsExt::construction_form
returns tokens suitable for deconstructing / constructing the relevant fields types.
- Breaking:
DeriveInputExt::tag_parameter
andDeriveInputExt::tag_parameters
returnNestedMeta
. - Breaking:
FieldExt::tag_parameter
andFieldExt::tag_parameters
returnNestedMeta
. util::tag_parameter
andutil::tag_parameters
are nowpub
.util::namespace_meta_list
is nowpub
.util::tag_meta_list
andutil::tag_meta_list_owned
are nowpub
.
syn
,quote
, andproc_macro2
are upgraded to1.0
.- Breaking:
nested_meta_to_ident
is renamed tonested_meta_to_path
.
- Breaking:
DeriveInputDeriveExt
is renamed toDeriveInputExt
. FieldExt::tag_parameter
extracts theMeta
param from#[namespace(tag(param))]
.FieldExt::tag_parameters
extracts theMeta
params from#[namespace(tag(param1, param2))]
.DeriveInputExt::tag_parameter
extracts theMeta
param from#[namespace(tag(param))]
.DeriveInputExt::tag_parameters
extracts theMeta
params from#[namespace(tag(param1, param2))]
.
-
FieldExt
provides methods to work withField
s:contains_tag
is_phantom_data
type_name
-
IdentExt::append
andIdentExt::prepend
create newIdent
s via concatenation. -
Added the following methods to
DeriveInputStructExt
:is_unit
is_named
is_tuple
assert_fields_unit
assert_fields_named
assert_fields_unnamed
-
Added
is_newtype
toDeriveInputNewtypeExt
.
- Breaking:
FieldsNamed::append
is renamed toFieldsNamed::append_named
. - Breaking:
FieldsUnnamed::append
is renamed toFieldsUnnamed::append_unnamed
.
DeriveInputDeriveExt
provides function to appendderive
s.DeriveInputNewtypeExt
provides functions to get newtype innerField
.DeriveInputStructExt
provides functions to get structField
s.FieldsNamedAppend
provides functions to appendFieldsNamed
.FieldsUnnamedAppend
provides functions to appendFieldsUnnamed
.nested_meta_to_ident
returns theIdent
of a nested meta.meta_list_contains
returns whether aMetaList
contains a specifiedNestedMeta
.ident_concat
returns anIdent
by concatenatingString
representations.