Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PoignardAzur/venial
/ functions
Functions
215 in github.com/PoignardAzur/venial
⨍
Functions
215
◇
Types & classes
49
↓ 66 callers
Function
parse_declaration_checked
(tokens: TokenStream)
src/tests.rs:19
↓ 35 callers
Function
parse_item
Parses the token stream of an item declaration. For instance, if you're implementing a derive macro, you can pass the token stream as-is. ## Panics
src/parse.rs:59
↓ 16 callers
Function
consume_ident
(tokens: &mut TokenIter, expected: &str)
src/parse_utils.rs:46
↓ 16 callers
Method
push
Add an items at the end of the list. If `comma` is None, sets `self.skip_last` to true, and adds a comma to the array with default values. That comma
src/punctuated.rs:29
↓ 13 callers
Function
consume_stuff_until
Consumes tokens until a separator is reached *unless* the separator in between angle brackets eg consume_stuff_until(..., |token| token == ',') will c
src/parse_utils.rs:218
↓ 12 callers
Function
parse_struct_declaration
(tokens: TokenStream)
src/tests.rs:961
↓ 11 callers
Method
quote_with
(&self, tokens: &mut TokenStream, f: impl FnOnce(&mut TokenStream))
src/types.rs:1078
↓ 10 callers
Function
parse_any_ident
(tokens: &mut TokenIter, panic_context: &str)
src/parse_utils.rs:13
↓ 9 callers
Function
consume_punct
(tokens: &mut TokenIter, expected: char)
src/parse_utils.rs:68
↓ 9 callers
Function
parse_punct
(tokens: &mut TokenIter, expected: char, panic_context: &str)
src/parse_utils.rs:57
↓ 9 callers
Method
with_param
Builder method, add a [`GenericParam`]. Add lifetime params to the beginning of the list.
src/types_edition.rs:559
↓ 8 callers
Function
consume_comma
(tokens: &mut TokenIter)
src/parse_utils.rs:275
↓ 8 callers
Method
len
Return number of items.
src/punctuated.rs:69
↓ 7 callers
Function
consume_where_clause
(tokens: &mut TokenIter)
src/parse_type.rs:215
↓ 6 callers
Function
consume_generic_params
(tokens: &mut TokenIter)
src/parse_type.rs:44
↓ 6 callers
Function
consume_outer_attributes
Outer macro attributes of the form `#[attribute]` Panics if any inner attributes such as `#![attribute]` are encountered.
src/parse_utils.rs:176
↓ 6 callers
Function
parse_ident
(tokens: &mut TokenIter, expected: &str, panic_context: &str)
src/parse_utils.rs:24
↓ 5 callers
Function
consume_item_name
(tokens: &mut TokenIter)
src/parse_type.rs:16
↓ 5 callers
Function
consume_vis_marker
(tokens: &mut TokenIter)
src/parse_utils.rs:187
↓ 5 callers
Method
is_empty
Return true if collection has no items.
src/punctuated.rs:74
↓ 5 callers
Method
items
Return an interator that reads items.
src/punctuated.rs:53
↓ 4 callers
Method
as_path
Tries to parse this type as a [`Path`] such as `path::to::Type<'a, other::Type>`. If it does not match a path, `None` is returned.
src/types_edition.rs:802
↓ 4 callers
Method
span
Returns a span in the first error. Note that, if span merging isn't enabled (currently nightly-only), the returned span will the smalled than the spa
src/error.rs:112
↓ 3 callers
Function
consume_bound
( tokens: &mut TokenIter, mut end_predicate: impl FnMut(&TokenTree) -> bool, )
src/parse_type.rs:20
↓ 3 callers
Function
consume_colon2
Parse `::`, as in path separator or turbofish. Does not advance `tokens` if the double colon is not found.
src/parse_utils.rs:282
↓ 3 callers
Function
consume_field_type
(tokens: &mut TokenIter)
src/parse_type.rs:280
↓ 3 callers
Function
format_debug_tokens
( f: &mut std::fmt::Formatter<'_>, tokens: &[TokenTree], )
src/types.rs:868
↓ 3 callers
Function
parse_const_or_static
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_impl.rs:19
↓ 3 callers
Function
parse_impl_body
( token_group: Group, allow_static: bool, )
src/parse_impl.rs:188
↓ 3 callers
Function
parse_named_fields
(token_group: Group)
src/parse_type.rs:358
↓ 2 callers
Function
consume_any_ident
(tokens: &mut TokenIter)
src/parse_utils.rs:35
↓ 2 callers
Function
consume_attributes_with_inner
Parse zero, one or more attributes. If `expect_inner` is true, then this will only parse inner attributes `#![...]` and stop *before* any outer attri
src/parse_utils.rs:85
↓ 2 callers
Function
consume_either_fn_type_const_static_impl
TODO could accept a mask, allowing only certain sub-items. This could be made to reject e.g. extern crate in impl blocks.
src/parse_impl.rs:122
↓ 2 callers
Function
consume_generic_args
(tokens: &mut TokenIter)
src/parse_type.rs:170
↓ 2 callers
Function
consume_inner_attributes
Inner macro attributes of the form `#![attribute]`. Stops _before_ encountering any outer attributes such as `#[attribute]`.
src/parse_utils.rs:183
↓ 2 callers
Function
consume_item
Consume an item declaration from a token stream. This is the same as [parse_item], except it doesn't panic if there are leftover tokens. ## Panics
src/parse.rs:86
↓ 2 callers
Function
consume_lifetime
( tokens: &mut Peekable<impl Iterator<Item = TokenTree>>, expect_end: bool, )
src/parse_type.rs:129
↓ 2 callers
Function
consume_macro
(tokens: &mut TokenIter, attributes: Vec<Attribute>)
src/parse_fn.rs:259
↓ 2 callers
Method
is_lifetime
Returns true if the generic param is a lifetime param.
src/types_edition.rs:668
↓ 2 callers
Function
parse_generic_args_checked
(tokens: TokenStream)
src/tests.rs:28
↓ 2 callers
Function
parse_impl
(tokens: &mut TokenIter, attributes: Vec<Attribute>)
src/parse_impl.rs:229
↓ 2 callers
Function
parse_mod
( tokens: &mut Peekable<IntoIter>, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_mod.rs:12
↓ 2 callers
Function
parse_trait
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_impl.rs:296
↓ 2 callers
Function
parse_tuple_fields
(token_group: Group)
src/parse_type.rs:326
↓ 2 callers
Function
tokens_from_slice
(slice: &[TokenTree])
src/parse_utils.rs:8
↓ 1 callers
Method
as_inline_args
See [`InlineGenericArgs`] for details.
src/types_edition.rs:569
↓ 1 callers
Function
consume_enum_discriminant
( tokens: &mut TokenIter, )
src/parse_type.rs:299
↓ 1 callers
Function
consume_extern_block
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_extern.rs:62
↓ 1 callers
Function
consume_extern_crate
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_extern.rs:14
↓ 1 callers
Function
consume_fn
Tries to parse a function definition. Panics when the following tokens do not constitute a function definition, with one exception: when `const` is f
src/parse_fn.rs:148
↓ 1 callers
Function
consume_fn_qualifiers
(tokens: &mut TokenIter)
src/parse_fn.rs:33
↓ 1 callers
Function
consume_fn_return
(tokens: &mut TokenIter)
src/parse_fn.rs:118
↓ 1 callers
Function
consume_macro_inner
(tokens: &mut TokenIter, attributes: Vec<Attribute>)
src/parse_fn.rs:273
↓ 1 callers
Function
consume_path
Tries to parse a path expressions; returns `None` if not matching.
src/parse_utils.rs:301
↓ 1 callers
Function
consume_ty_definition
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_impl.rs:78
↓ 1 callers
Method
generic_params
Returns the [`GenericParamList`], if any, of the declaration. For instance, this will return Some for `struct MyStruct<A, B, C> { ... }`, Some for `i
src/types_edition.rs:63
↓ 1 callers
Method
has_only_const_xor_unsafe
Whether exactly either `const` or `unsafe` attribute is set, and no other one (so the tokens could be the start of a constant or impl declaration)
src/types_edition.rs:546
↓ 1 callers
Method
insert
Inserts an element at position `index`. # Panics Panics if `index` is greater than the number of elements previously in this punctuated sequence.
src/punctuated.rs:41
↓ 1 callers
Method
is_empty_variant
Returns true if the variant doesn't store a type.
src/types_edition.rs:527
↓ 1 callers
Function
parse_enum_variants
(tokens: TokenStream)
src/parse_type.rs:394
↓ 1 callers
Function
parse_extern_block
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_extern.rs:54
↓ 1 callers
Function
parse_extern_crate
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_extern.rs:6
↓ 1 callers
Function
parse_fn_params
(tokens: TokenStream)
src/parse_fn.rs:72
↓ 1 callers
Function
parse_generic_arg
(tokens: Vec<TokenTree>)
src/parse_type.rs:95
↓ 1 callers
Function
parse_use_declaration
( tokens: &mut TokenIter, attributes: Vec<Attribute>, vis_marker: Option<VisMarker>, )
src/parse_mod.rs:68
↓ 1 callers
Method
span
Returns span of this item.
src/types_edition.rs:858
↓ 1 callers
Method
to_owned_args
Returns an owned argument list from this. # Panics If `self` is a mal-formed generic argument list.
src/types_edition.rs:694
↓ 1 callers
Method
unwrap_invisible_group
If the type has a top-level `Group` token without separator, extract the contents. Otherwise return `None`.
src/types_edition.rs:813
↓ 1 callers
Method
with_predicate
Builder method, add a predicate to the where-clause.
src/types_edition.rs:751
Method
__no_split_for_impl__
()
src/types_edition.rs:263
Function
add_bounded_lifetime
()
src/tests.rs:1014
Function
add_bounded_ty_param
()
src/tests.rs:1053
Function
add_const_param
()
src/tests.rs:1070
Function
add_lifetime
()
src/tests.rs:984
Function
add_ty_param
()
src/tests.rs:1031
Function
add_where_item
()
src/tests.rs:1098
Method
as_constant
Returns the [`Constant`] variant of the enum if possible.
src/types_edition.rs:203
Method
as_enum
Returns the [`Enum`] variant of the enum if possible.
src/types_edition.rs:147
Method
as_extern_block
Returns the [`ExternBlock`] variant of the enum if possible.
src/types_edition.rs:227
Method
as_extern_crate
Returns the [`ExternCrate`] variant of the enum if possible.
src/types_edition.rs:235
Method
as_function
Returns the [`Function`] variant of the enum if possible.
src/types_edition.rs:195
Method
as_impl
Returns the [`Impl`] variant of the enum if possible.
src/types_edition.rs:179
Method
as_macro
Returns the [`Macro`] variant of the enum if possible.
src/types_edition.rs:219
Method
as_module
Returns the [`Module`] variant of the enum if possible.
src/types_edition.rs:163
Method
as_struct
Returns the [`Struct`] variant of the enum if possible.
src/types_edition.rs:139
Method
as_trait
Returns the [`Trait`] variant of the enum if possible.
src/types_edition.rs:171
Method
as_type_alias
Returns the [`TypeAlias`] variant of the enum if possible.
src/types_edition.rs:187
Method
as_union
Returns the [`Union`] variant of the enum if possible.
src/types_edition.rs:155
Method
as_use_declaration
Returns the [`UseDeclaration`] variant of the enum if possible.
src/types_edition.rs:211
Method
attributes
Returns the [`Vec<Attribute>`] of the declaration. This method is provided for convenience, but it's more idiomatic to match on Declaration and use t
src/types_edition.rs:16
Method
attributes_mut
Returns the [`Vec<Attribute>`] of the declaration. This method is provided for convenience, but it's more idiomatic to match on Declaration and use t
src/types_edition.rs:37
Method
bounded_lifetime
Create new lifetime param from name and bound. ``` # use venial::GenericParam; # use quote::quote; GenericParam::bounded_lifetime("a", quote!(b + c).
src/types_edition.rs:599
Method
bounded_ty
Create new type param from name and bound. ``` # use venial::GenericParam; # use quote::quote; GenericParam::bounded_ty("T", quote!(Debug + Eq).into_
src/types_edition.rs:635
Method
combine
Add another error message to self such that when `to_compile_error()` is called, both errors will be emitted together.
src/error.rs:130
Method
const_param
Create new const param from name and type. ``` # use venial::GenericParam; # use quote::quote; GenericParam::const_param("N", quote!(i32).into_iter()
src/types_edition.rs:655
Method
default
()
src/types.rs:1671
Method
default
()
src/punctuated.rs:82
Method
deref
(&self)
src/punctuated.rs:117
Method
deref_mut
(&mut self)
src/punctuated.rs:123
Method
field_names
Returns a collection of strings that can be used to exhaustively access the struct's fields. If the struct is a tuple struct, integer strings will be
src/types_edition.rs:298
next →
1–100 of 215, ranked by callers