Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/JelteF/derive_more
/ functions
Functions
1,002 in github.com/JelteF/derive_more
⨍
Functions
1,002
◇
Types & classes
818
↓ 189 callers
Method
map
Maps the wrapped `item` with the provided `f`unction, preserving the current [`Span`].
impl/src/utils.rs:1462
↓ 86 callers
Method
as_mut
(&mut self)
tests/as_mut.rs:22
↓ 85 callers
Method
as_ref
(&self)
tests/as_ref.rs:21
↓ 81 callers
Method
len
(&self)
impl/src/utils.rs:2410
↓ 81 callers
Method
span
Returns the [`Span`] contained in this [`Spanning`] wrapper.
impl/src/utils.rs:1449
↓ 38 callers
Method
into_iter
(self)
tests/into_iterator.rs:86
↓ 37 callers
Method
as_ref
Converts this `&`[`Spanning`]`<T>` into [`Spanning`]`<&T>` (moves the reference inside).
impl/src/utils.rs:1454
↓ 36 callers
Function
map
Maps output of the parser in case it returned [`Some`].
impl/src/fmt/parsing.rs:565
↓ 24 callers
Function
char
Checks whether `input` starts with `c`.
impl/src/fmt/parsing.rs:669
↓ 19 callers
Method
next
(&mut self)
impl/src/utils.rs:1377
↓ 18 callers
Method
is_ident
(&self, ident: &I)
impl/src/utils.rs:1091
↓ 17 callers
Function
assert_iter
(iter: I, vals: &[T])
tests/into_iterator.rs:15
↓ 12 callers
Method
contains_type_structurally
(&self, needle: &Self)
impl/src/utils.rs:2893
↓ 10 callers
Function
alt
Returns first successful parser or [`None`] in case all of them returned [`None`].
impl/src/fmt/parsing.rs:558
↓ 10 callers
Method
write_str
(&mut self, s: &str)
src/fmt.rs:177
↓ 9 callers
Function
add_extra_where_clauses
( generics: &Generics, type_where_clauses: TokenStream, )
impl/src/utils.rs:221
↓ 9 callers
Function
punct
Tries to parse a [`Punct`]. [`Punct`]: proc_macro2::Punct
impl/src/parsing.rs:118
↓ 8 callers
Method
parse_args_with
(&self, parser: F)
impl/src/utils.rs:1145
↓ 7 callers
Method
enabled_fields_data
(&'state self)
impl/src/utils.rs:607
↓ 7 callers
Method
enabled_variant_data
( &'state self, )
impl/src/utils.rs:660
↓ 7 callers
Method
get_ident
(&self)
impl/src/utils.rs:1101
↓ 7 callers
Method
matcher
( &self, indexes: &[usize], bindings: &[T], )
impl/src/utils.rs:799
↓ 7 callers
Function
optional_result
Makes underlying `parser` optional by returning the original `input` and [`None`] in case it returned [`None`].
impl/src/fmt/parsing.rs:600
↓ 7 callers
Method
transpose
(self)
impl/src/utils.rs:1475
↓ 6 callers
Method
additional_deref_args
Returns an [`Iterator`] over the additional formatting arguments doing the dereferencing replacement in this [`FmtAttribute`] for those [`Placeholder`
impl/src/fmt/mod.rs:312
↓ 6 callers
Method
any_in
Checks the provided [`syn::Type`] to contain anything from this [`GenericsSearch`].
impl/src/utils.rs:2549
↓ 6 callers
Method
convert_case
Converts the provided `name` into the case of this [`RenameAll`].
impl/src/utils.rs:2333
↓ 6 callers
Method
ident
Returns a [`syn::Ident`] in case this [`Expr`] is represented only by it. [`syn::Ident`]: struct@syn::Ident
impl/src/parsing.rs:28
↓ 6 callers
Method
replace_self_type
(&self)
impl/src/utils.rs:2718
↓ 5 callers
Method
assert_single_enabled_field
( &'state self, )
impl/src/utils.rs:584
↓ 5 callers
Function
check_char
Checks whether first [`char`] suits `check`. [`char`]: fn@char
impl/src/fmt/parsing.rs:676
↓ 5 callers
Method
contains_generics
(&self, type_params: &[&syn::Ident])
impl/src/fmt/mod.rs:592
↓ 5 callers
Function
named_to_vec
(fields: &FieldsNamed)
impl/src/utils.rs:258
↓ 5 callers
Method
non_exhaustive_arm_pattern
( &self, prefix: &str, skipped_indices: &HashSet<usize>, )
impl/src/utils.rs:3066
↓ 5 callers
Function
unnamed_to_vec
(fields: &FieldsUnnamed)
impl/src/utils.rs:254
↓ 4 callers
Function
and_then
Returns [`None`] if the parser returned is [`None`], otherwise calls `f` with the wrapped value and returns the result.
impl/src/fmt/parsing.rs:583
↓ 4 callers
Method
bounded_types
Returns an [`Iterator`] over bounded [`syn::Type`]s (and correspondent trait names) by this [`FmtAttribute`].
impl/src/fmt/mod.rs:229
↓ 4 callers
Function
format
Parses a `format` as defined in the [grammar spec][0]. # Grammar [`format`]` := '{' [`[`argument`]`] [':' `[`format_spec`]`] '}'` # Example ```tex
impl/src/fmt/parsing.rs:252
↓ 4 callers
Function
numbered_vars
(count: usize, prefix: &str)
impl/src/utils.rs:135
↓ 4 callers
Function
panic_one_field
(trait_name: &str, trait_attr: &str)
impl/src/utils.rs:262
↓ 4 callers
Function
str
Checks whether `input` starts with `s`.
impl/src/fmt/parsing.rs:664
↓ 3 callers
Function
add_extra_ty_param_bound
( generics: &'a Generics, bound: &'a TokenStream, )
impl/src/utils.rs:176
↓ 3 callers
Function
assert
(input: &'a str, parsed: impl AsRef<[&'a str]>)
impl/src/fmt/mod.rs:729
↓ 3 callers
Function
balanced_pair
Parses until balanced amount of `open` and `close` or eof. [`Cursor`] should be pointing **right after** the first `open`ing.
impl/src/parsing.rs:136
↓ 3 callers
Function
empty
()
tests/eq.rs:333
↓ 3 callers
Method
exhaustive_arm_pattern
(&self, prefix: &str)
impl/src/utils.rs:3103
↓ 3 callers
Method
expand_fields
Expands fields initialization wrapped into [`token::Brace`]s in case of [`syn::FieldsNamed`], or [`token::Paren`] in case of [`syn::FieldsUnnamed`].
impl/src/from.rs:268
↓ 3 callers
Function
failed_block
(state: &State, enum_name: &Ident, fn_name: &Ident)
impl/src/unwrap.rs:148
↓ 3 callers
Function
failed_block
(state: &State, enum_name: &Ident, func_name: &Ident)
impl/src/try_unwrap.rs:153
↓ 3 callers
Function
get_meta_info
( trait_attr: &str, attrs: &[Attribute], allowed_attr_params: &[&str], )
impl/src/utils.rs:820
↓ 3 callers
Method
get_option_inner
Returns the inner [`syn::Type`] if this one represents an [`Option`].
impl/src/error.rs:531
↓ 3 callers
Method
into_full
(self, defaults: FullMetaInfo)
impl/src/utils.rs:1238
↓ 3 callers
Method
is_option
(&self)
impl/src/error.rs:537
↓ 3 callers
Method
is_pretty
(&self)
src/fmt.rs:155
↓ 3 callers
Method
is_ref
(self)
impl/src/utils.rs:121
↓ 3 callers
Function
is_type_path_ends_with_segment
Checks if `ty` is [`syn::Type::Path`] and ends with segment matching `tail` and doesn't contain any generic parameters.
impl/src/error.rs:356
↓ 3 callers
Method
lifetime
(self)
impl/src/utils.rs:82
↓ 3 callers
Function
map_or_else
Maps output of the parser in case it returned [`Some`] or uses `default`.
impl/src/fmt/parsing.rs:573
↓ 3 callers
Function
seq
Tries to execute the provided sequence of `parsers`.
impl/src/parsing.rs:164
↓ 3 callers
Function
transmute
Nasty [`mem::transmute()`] that works in generic contexts by [`mem::forget`]ing stuff. It's OK for tests!
tests/into.rs:25
↓ 3 callers
Method
transparent_call_on_fields
Same as [`transparent_call()`], but additionally checks the returned [`Expr`] whether it's one of the [`fmt_args_idents`] of the provided [`syn::Field
impl/src/fmt/mod.rs:209
↓ 2 callers
Function
add_extra_generic_param
( generics: &Generics, generic_param: TokenStream, )
impl/src/utils.rs:189
↓ 2 callers
Method
add_trait_path_type_param
(&mut self, param: TokenStream)
impl/src/utils.rs:580
↓ 2 callers
Function
add_where_clauses_for_new_ident
( generics: &'a Generics, fields: &[&'a Field], type_ident: &Ident, type_where_clauses: TokenS
impl/src/utils.rs:235
↓ 2 callers
Method
alias
Returns an `identifier` of the [named parameter][1]. [1]: https://doc.rust-lang.org/stable/std/fmt/index.html#named-parameters
impl/src/fmt/mod.rs:396
↓ 2 callers
Function
allowed_attr_params
()
impl/src/error.rs:175
↓ 2 callers
Function
assert_iter_contains_zero_or_one_item
( mut iter: impl Iterator<Item = (usize, &'a syn::Field, &'a MetaInfo)>, error_msg: &str, )
impl/src/error.rs:483
↓ 2 callers
Method
body
Generates body of the method implementation for this [`StructuralExpansion`].
impl/src/ops/mod.rs:57
↓ 2 callers
Method
body
Generates body of the [`PartialEq::eq()`]/[`PartialEq::ne()`] method implementation for this [`StructuralExpansion`], if it's required.
impl/src/cmp/partial_eq.rs:108
↓ 2 callers
Method
contains_arg
Checks whether this [`FmtAttribute`] contains an argument with the provided `name` (either in its direct [`FmtArgument`]s or inside [`Placeholder`]s).
impl/src/fmt/mod.rs:272
↓ 2 callers
Method
enabled_infos
(&self)
impl/src/utils.rs:738
↓ 2 callers
Method
expand
Expands [`From`] implementations for a struct or an enum variant.
impl/src/from.rs:148
↓ 2 callers
Method
field_idents
(&self)
impl/src/utils.rs:701
↓ 2 callers
Method
fmt_args_idents
(&self)
impl/src/fmt/mod.rs:715
↓ 2 callers
Method
generate_body
Generates [`Display::fmt()`] implementation for a struct or an enum variant. # Errors In case [`FmtAttribute`] is [`None`] and [`syn::Fields`] lengt
impl/src/fmt/display.rs:405
↓ 2 callers
Method
generate_body
Generates [`Debug::fmt()`] implementation for a struct or an enum variant. [`Debug::fmt()`]: std::fmt::Debug::fmt()
impl/src/fmt/debug.rs:253
↓ 2 callers
Method
generate_bounds
Generates trait bounds for a struct or an enum variant.
impl/src/fmt/display.rs:500
↓ 2 callers
Method
generate_bounds
Generates trait bounds for a struct or an enum variant.
impl/src/fmt/debug.rs:377
↓ 2 callers
Method
get_inner_if
(&self, filter: impl Fn(&syn::Ident) -> bool)
impl/src/error.rs:541
↓ 2 callers
Method
into_inner
Destructures this [`Spanning`] wrapper returning the underlying `item`.
impl/src/utils.rs:1441
↓ 2 callers
Method
is_trivial
Indicates whether this [`Type`] represents a trivial trait call without any modifications.
impl/src/fmt/parsing.rs:130
↓ 2 callers
Function
lookahead
Checks whether `parser` is successful while not advancing the original `input`.
impl/src/fmt/parsing.rs:592
↓ 2 callers
Method
parse
(input: ParseStream<'_>)
impl/src/utils.rs:1073
↓ 2 callers
Method
parse
(input: ParseStream<'_>)
impl/src/fmt/mod.rs:38
↓ 2 callers
Function
parse_field_impl
( is_valid_default_field_for_attr: &P, len: usize, iter: impl Iterator<Item = (usize, &'a syn::Fie
impl/src/error.rs:443
↓ 2 callers
Function
parse_fields
( type_params: &HashSet<syn::Ident>, state: &'state State<'input>, )
impl/src/error.rs:293
↓ 2 callers
Function
parse_fields_impl
( state: &'state State<'input>, is_valid_default_field_for_attr: P, )
impl/src/error.rs:399
↓ 2 callers
Method
placeholders_by_arg
Returns an [`Iterator`] over [`Placeholder`]s using an argument with the provided `name` (either in its direct [`FmtArgument`]s of this [`FmtAttribute
impl/src/fmt/mod.rs:280
↓ 2 callers
Method
ref_types
(&self)
impl/src/utils.rs:1251
↓ 2 callers
Method
reference_with_lifetime
(self)
impl/src/utils.rs:112
↓ 2 callers
Function
render_some
(mut expr: TokenStream, unpack: bool)
impl/src/error.rs:286
↓ 2 callers
Method
self_constructor
Generates a `Self` type constructor with the provided `values` assigned to these [`syn::Fields`]. # Panics If number of provided `values` doesn't ma
impl/src/from_str.rs:356
↓ 2 callers
Method
self_constructor_empty
Generates a `Self` type constructor with no fields. # Panics If these [`syn::Fields`] are not [empty]. [empty]: syn::Fields::is_empty
impl/src/from_str.rs:370
↓ 2 callers
Method
shared_attr_info
Checks and indicates whether a top-level shared [`FmtAttribute`] is present in this [`Expansion`], and whether it has wrapping logic (e.g. uses `_vari
impl/src/fmt/display.rs:382
↓ 2 callers
Function
struct_body
(return_type: &Ident, fields: &[&Field])
impl/src/constructor.rs:54
↓ 2 callers
Function
take_while1
Parses while `parser` is successful. Returns [`None`] in case `parser` never succeeded.
impl/src/fmt/parsing.rs:623
↓ 2 callers
Method
to_tokens
(&self, tokens: &mut TokenStream)
impl/src/utils.rs:1082
↓ 2 callers
Method
trait_name
Returns trait name of this [`Type`].
impl/src/fmt/parsing.rs:115
↓ 2 callers
Method
transparent_call
Checks whether this [`FmtAttribute`] can be replaced with a transparent delegation (calling a formatting trait directly instead of interpolation synta
impl/src/fmt/mod.rs:149
↓ 2 callers
Method
validate_attrs
Validates attributes of this [`Expansion`] to be consistent.
impl/src/fmt/debug.rs:229
next →
1–100 of 1,002, ranked by callers