Expand description
Rust code syntax is available through this module.
Structs§
- Allow
Lints - The attribute content for
allow(...). The tuple value must be a sequence. - Associated
Item - An item attached to an associated container, via “::”.
The output will look like
Cont::Item. - Associated
Type Def - Declares an associated type, rendering as
type VarName = Value;. Adds new lines before and after. - Associated
Type Equals - Renders as
Type=Value. Intended to be used as a type argument, to specify associated types. - Attributes
Accept - A sequence acceptor that writes attributes
- Bounded
Type Var - A type variable with a sequence of bounds.
Will render as
TypeVar: B1 + B2 + ... - Closure
- Writes a closure. Adds new lines inside the brackets, wrapping the inner expression.
- DynOf
- Adds a “dyn “ before a type expression.
- Function
- The base struct for a function. Includes name and arguments. This function is re-used in other places and is likely not helpful by itself.
- Function
Body Declare - Declares a function body. This is equivalent to just a semicolon.
- Function
Call - Performs a call to a function inside code.
- Function
Def - A function declaration
- Function
Param - Renders an individual function parameter,
Name: Type - ImplOf
- Adds a “impl “ before a type expression
- LetStmt
- A let statement. This statement includes the semi-colon and a new line.
- Lifetimed
RefOf - Adds a reference with a lifetime before a type expression, i.e.
&'<lifetime> <type> - ModExtern
- The extern modifier, with the ABI selected as the tuple value
- ModPub
- The public modifier
- OkResult
Of - Wraps an expression in
Ok(EXPR). - Parameterized
- A type argument-parameterized expression. Used in relation to parameterized names and their
arguments. Examples:
function_name<args>,TypeName<'lifetime, args>,MyType<Assoc=Value>. - Question
Mark After - A question mark following another expression.
- RefOf
- Adds a “&” before a type expression
- Trait
Def - The declaration of a trait
- Trait
Impl - The implementation declaration for a trait, applying to a certain receiver.
- Type
AsTrait - Uses the
asexpression to perform a qualified trait cast (ready for a method call). I.e., this will render as<TYPE as OTHER>. - Unsafe
Block - Places the expression inside an unsafe block. Adds new lines inside the brackets, wrapping the inner expression.
Enums§
- Edition
- All possible Rust editions. This is the only type in this module meant to be used as context, and not as a writable itself.