Expand description
Exposed namespace of the module.
Modules§
- attr
- Attributes analyzys and manipulation.
- attr_
prop - Attribute’s properties. Reuse them to define how to parse properties of an attribute.
- collection
- Function and structures to work with collections. Module containing all collection macros
- components
- Type-based assigning.
- container_
kind - Determine kind of a container.
- ct
- Compile-time tools.
- derive
- Macro helpers around derive macro and structure
syn::DeriveInput. - diag
- Macro helpers.
- equation
- Attributes analyzys and manipulation.
- error
- Errors handling.
Alias for
std::error::BasicError. - generic_
args - This module provides utilities to handle and manipulate generic arguments using the
syncrate. It includes traits and functions for transforming, merging, and managing generic parameters within procedural macros, enabling seamless syntactic analysis and code generation. - generic_
params - Functions and structures to handle and manipulate generic parameters using the
syncrate. It’s designed to support macro-driven code generation by simplifying, merging, extracting, and decomposingsyn::Generics. - ident
- Utilities for manipulating identifiers, including keyword handling.
- item
- This module provides various utilities and namespaces for working with
syn::Item, specifically focusing on ensuring syntactical correctness and managing different visibility levels within the code. It includes functions to manipulate the structure of items, handle different kinds of fields, and provide a structured approach to organizing the codebase into different access levels. - item_
struct - Parse structures, like
struct { a : i32 }. - kw
- Keywords
- name
- Tait to getn name of an Item.
- phantom
- Responsible for generating marker
PhantomDatafields to avoid the rule requiring the usage of all generic parameters in a struct. This is often necessary to ensure that Rust’s type system correctly tracks the ownership and lifetimes of these parameters without needing them to be explicitly used in the struct’s fields. - proc_
macro2 - github crates-io docs-rs
- punctuated
- Structures and functions for handling
syn::punctuated::Punctuatedcollections. - quantifier
- Quantifiers like Pair and Many.
- quote
- github crates-io docs-rs
- struct_
like - Parse structures, like
struct { a : i32 }. - syn
- github crates-io docs-rs
- thiserror
- Errors handling. github crates-io docs-rs
- tokens
- Attributes analyzys and manipulation.
- typ
- Advanced syntax elements.
- typed
- Typed parsing.
Macros§
- Token
- A type-macro that expands to the name of the Rust type representation of a given token.
- bmap
- Function and structures to work with collections.
Creates a
BTreeMapfrom a list of key-value pairs. - braced
- Parse a set of curly braces and expose their content to subsequent parsers.
- bracketed
- Parse a set of square brackets and expose their content to subsequent parsers.
- bset
- Function and structures to work with collections.
Creates a
BTreeSetfrom a list of elements. - code_
diagnostics_ str - Macro for diagnostics purpose to diagnose source code behind it and export it into a string.
- code_
print - Macro for diagnostics purpose to print both syntax tree and source code behind it without syntax tree.
- code_
to_ str - Macro to export source code behind a syntax tree into a string.
- custom_
keyword - Define a type that supports parsing and printing a given identifier as if it were a keyword.
- custom_
punctuation - Define a type that supports parsing and printing a multi-character symbol as if it were a punctuation token.
- debug_
assert_ id - Errors handling.
- debug_
assert_ identical - Errors handling.
Macro asserts that two expressions are identical to each other. Unlike
std::assert_eqit is removed from a release build. Alias ofdebug_assert_id. - debug_
assert_ ni - Errors handling.
Macro asserts that two expressions are not identical to each other. Unlike
std::assert_eqit is removed from a release build. - debug_
assert_ not_ identical - Errors handling.
Macro asserts that two expressions are not identical to each other. Unlike
std::assert_eqit is removed from a release build. - deque
- Function and structures to work with collections.
Creates a
VecDequefrom a list of elements. - dlist
- Function and structures to work with collections.
Creates a
Vecfrom a list of elements. - format_
ident - Formatting macro for constructing
Idents. - hmap
- Function and structures to work with collections.
Creates a
HashMapfrom a list of key-value pairs. - hset
- Function and structures to work with collections.
Creates a
HashSetfrom a list of elements. - into_
bmap - Function and structures to work with collections.
Creates a
BTreeMapfrom a list of key-value pairs. - into_
bset - Function and structures to work with collections.
Creates a
BTreeSetfrom a list of elements. - into_
dlist - Function and structures to work with collections.
Creates a
Vecfrom a list of elements. - into_
hmap - Function and structures to work with collections.
Creates a
HashMapfrom a list of key-value pairs. - into_
hset - Function and structures to work with collections.
Creates a
HashSetfrom a list of elements. - into_
llist - Function and structures to work with collections.
Creates a
LinkedListfrom a llist of elements. - into_
vec - Function and structures to work with collections.
Creates a
Vecfrom a list of elements. - into_
vecd - Function and structures to work with collections.
Creates a
VecDequefrom a list of elements. - llist
- Function and structures to work with collections.
Creates a
LinkedListfrom a llist of elements. - parenthesized
- Parse a set of parentheses and expose their content to subsequent parsers.
- parse_
macro_ input - Parse the input TokenStream of a macro, triggering a compile error if the tokens fail to parse.
- parse_
qt - Quasi-quotation macro that accepts input like the
quote!macro but uses type inference to figure out a return type for those tokens. - parse_
qt_ spanned - This macro is
parse_quote!+quote_spanned!. - parse_
quote - Quasi-quotation macro that accepts input like the
quote!macro but uses type inference to figure out a return type for those tokens. - parse_
quote_ spanned - This macro is
parse_quote!+quote_spanned!. - qt
- The whole point.
- quote
- The whole point.
- quote_
spanned - Same as
quote!, but applies a given span to all tokens originating within the macro invocation. - return_
syn_ err - Macro to generate syn error either with span of a syntax tree element or with default one
proc_macro2::Span::call_site(). - syn_err
- Macro to generate syn error either with span of a syntax tree element or with default one
proc_macro2::Span::call_site(). - tree_
diagnostics_ str - Macro for diagnostics purpose to export both syntax tree and source code behind it into a string.
- tree_
print - Macro for diagnostics purpose to print both syntax tree and source code behind it with syntax tree.
Structs§
- Absolute
Path - A new type representing an absolute path.
- Attribute
Property Boolean - A generic boolean attribute property.
Defaults to
false. - Attribute
Property Boolean Marker - Default marker for
AttributePropertyBoolean. Used if no marker is defined as parameter. - Attribute
Property Optional Boolean - A generic optional boolean attribute property:
Option< bool >. Defaults tofalse. - Attribute
Property Optional Boolean Marker - Default marker for
AttributePropertyOptionalSingletone. Used if no marker is defined as parameter. - Attribute
Property Optional Singletone - A generic attribute property for switching on/off.
Has 3 states:
None,Some( true ),Some( false ). Defaults toNone. - Attribute
Property Optional Singletone Marker - Default marker for
AttributePropertyOptionalSingletone. Used if no marker is defined as parameter. - Attribute
Property Optional Syn - Property of an attribute which simply wraps one of the standard
syntypes and keeps it optional. - Attribute
Property Optional SynMarker - Default marker for
AttributePropertyOptionalSyn. Used if no marker is defined as parameter. - Attribute
Property Singletone - A generic boolean attribute property which consists of only keyword.
This property can have two states:
true, orfalse. Defaults tofalse. - Attribute
Property Singletone Marker - Default marker for
AttributePropertySingletone. Used if no marker is defined as parameter. - Attribute
Property Syn - Property of an attribute which simply wraps one of the standard
syntypes. - Attribute
Property SynMarker - Default marker for
AttributePropertySyn. Used if no marker is defined as parameter. - Attributes
Inner - Attribute which is inner.
- Attributes
Outer - Represents a collection of outer attributes.
- BTree
Map - Function and structures to work with collections. An ordered map based on a B-Tree.
- BTree
Set - Function and structures to work with collections. An ordered set based on a B-Tree.
- Binary
Heap - Function and structures to work with collections. A priority queue implemented with a binary heap.
- Bmap
- Function and structures to work with collections. An ordered map based on a B-Tree.
- Bset
- Function and structures to work with collections. An ordered set based on a B-Tree.
- Canonical
Path - Caninical path.
- Crate
Dir - Path to crate directory
- Current
Path - Symbolize current path.
- Dependency
Ref - A dependency of the main crate
- Deque
- Function and structures to work with collections. A double-ended queue implemented with a growable ring buffer.
- Dlist
- Function and structures to work with collections.
A contiguous growable array type, written as
Vec<T>, short for ‘vector’. - Either
DirOr File - Wrapper over
data_type::Either< CrateDir, ManifestFile >with util methods. - Equation
- Represents an equation parsed from a procedural macro input.
- HashMap
- Function and structures to work with collections. A hash map implemented with quadratic probing and SIMD lookup.
- HashSet
- Function and structures to work with collections.
A hash set implemented as a
HashMapwhere the value is(). - Hmap
- Function and structures to work with collections. A hash map implemented with quadratic probing and SIMD lookup.
- Hset
- Function and structures to work with collections.
A hash set implemented as a
HashMapwhere the value is(). - Linked
List - Function and structures to work with collections. A doubly-linked list with owned nodes.
- Llist
- Function and structures to work with collections. A doubly-linked list with owned nodes.
- Manifest
- Hold manifest data.
- Manifest
File - Path to crate directory
- Many
- Parse as much elements as possible.
- Map
- Function and structures to work with collections. A hash map implemented with quadratic probing and SIMD lookup.
- Native
Path - Caninical path.
- Pair
- Pair of two elements of parsing.
- Set
- Function and structures to work with collections.
A hash set implemented as a
HashMapwhere the value is(). - Source
File - Path to a source file
- Tokens
Tokensis a wrapper aroundproc_macro2::TokenStream. It is designed to facilitate the parsing and manipulation of token streams within procedural macros.- Vec
- Function and structures to work with collections.
A contiguous growable array type, written as
Vec<T>, short for ‘vector’. - VecDeque
- Function and structures to work with collections. A double-ended queue implemented with a growable ring buffer.
- Version
- Version entity.
Wrapper for a
SemVerstructure - Workspace
- Stores information about the current workspace.
- Workspace
Package Ref - Facade for
cargo_metadata::Package
Enums§
- Dependency
Kind - Dependencies can come in three kinds
- Diff
- A type returned by the
diff_withfunction. - Either
- The enum
Eitherwith variantsLeftandRightis a general purpose sum type with two cases. - Either
OrBoth - Value that either holds a single A or B, or both.
- Fold
While - An enum used for controlling the execution of
fold_while. - MinMax
Result MinMaxResultis an enum returned byminmax.- Package
- Represents different types of packages in a Cargo workspace.
- Path
Error PathErrorenum represents errors when creating aCrateDirobject.- Position
- The first component of the value yielded by
WithPosition. Indicates the position of this element in the iterator results. - Workspace
Init Error - Represents errors related to workspace operations.
Traits§
- AsCode
- A trait for converting an object to its code representation.
- AsMuch
AsPossible NoDelimiter - Marker saying how to parse several elements of such type in a row.
- Assign
- Provides a generic interface for setting a component of a certain type on an object.
- Assign
With Type - The
AssignWithTypetrait provides a mechanism to set a component on an object, utilizing the type information explicitly. This trait extends the functionality ofAssignby allowing implementers to specify the component’s type at the method call site, enhancing expressiveness in code that manipulates object states. - Attribute
Component - Trait for components of a structure aggregating attributes that can be constructed from a meta attribute.
- Attribute
Property Component - Trait for properties of an attribute component that can be identified by a keyword.
- Code
Items - A trait for retrieving an iterator over items of a source file.
- Entries
- A trait that defines a method for retrieving an iterator over entries.
- ErrWith
- Errors handling. This trait allows adding extra context or information to an error, creating a tuple of the additional context and the original error. This is particularly useful for error handling when you want to include more details in the error without losing the original error value.
- Into
Interval - Convert it into canonical interval.
- IterExt
- Extension of iterator.
- Iter
Trait - Trait that encapsulates a clonable iterator with specific characteristics, tailored for use with the
syncrate. - Iterable
Interval - Interval adapter. Interface to interval-like structures.
- Itertools
- An
Iteratorblanket implementation that provides extra adaptors and methods. - Name
- Trait to get name of an syntax element.
- NonIterable
Interval - Interval adapter. Interface to interval-like structures.
- Option
Ext - Extension trait to provide a method for setting a component on an
Option<Self>if theOptionis currentlyNone. If theOptionisSome, the method will delegate to theAssigntrait’sassignmethod. - Path
Joined - A trait for joining path components into a
PathBuf. - Peeking
Next - An iterator that allows peeking at an element before deciding to accept it.
- Sources
- A trait that defines a method for retrieving an iterator over source files.
- Spanned
- A trait that can provide the
Spanof the complete contents of a syntax tree node. - Transitive
TryFrom - A trait to perform a transitive
try_fromconversion. - Transitive
TryInto - A trait to perform a transitive
try_intoconversion. - _Iter
Trait - Trait that encapsulates an iterator with specific characteristics and implemetning
CloneDyn.
Functions§
- cicd_
renew - List packages.
- indentation
- Adds indentation and optional prefix/postfix to each line of the given string.
- is
- Check is string a keyword.
- report_
format - Formats a debugging report for code transformation processes, detailing both the original and generated code for easy comparison and review.
- report_
print - Prints a debugging report for a pair of token streams to the standard output.
- test
- run tests in specified crate run tests in specified crate
- workspace_
renew - List packages.
Type Aliases§
- Boxed
Iter - Type alias for boxed
_IterTraittrait objects. - Parse
Stream - Input to a Syn parser function.
- Result
With Report - Errors handling.
A type alias for a
Resultthat contains an error which is a tuple of a report and an original error.