Module ast

Source

Re-exportsยง

pub use attrs::Attrs;

Modulesยง

attrs
As part of the macro expansion and code generation process, Diplomat generates a simplified version of the Rust AST that captures special types such as opaque structs, Box, and Result with utilities for handling such types. This module contains utilities for dealing with Rust attributes
docs ๐Ÿ”’
enums ๐Ÿ”’
idents ๐Ÿ”’
lifetimes ๐Ÿ”’
methods ๐Ÿ”’
modules ๐Ÿ”’
paths ๐Ÿ”’
structs ๐Ÿ”’
types ๐Ÿ”’

Structsยง

BorrowedParams
Parameters in a method that might be borrowed in the return type.
Docs
DocsUrlGenerator
Enum
A fieldless enum declaration in an FFI module.
File
Ident
An identifier, analogous to syn::Ident and proc_macro2::Ident.
LifetimeEnv
A lifetime dependency graph used for tracking which lifetimes outlive, and are outlived by, other lifetimes.
LifetimeTransitivity
Collect all lifetimes that are either longer_or_shorter
Method
A method declared in the impl associated with an FFI struct. Includes both static and non-static methods, which can be distinguished by inspecting Method::self_param.
Module
NamedLifetime
A named lifetime, e.g. 'a.
OpaqueStruct
A struct annotated with [diplomat::opaque] whose fields are not visible. Opaque structs cannot be passed by-value across the FFI boundary, so they must be boxed or passed as references.
Param
A parameter taken by a Method, not including self.
Path
PathType
A named type that is just a path, e.g. std::borrow::Cow<'a, T>.
RustLink
SelfParam
The self parameter taken by a Method.
Struct
A struct declaration in an FFI module that is not opaque.

Enumsยง

CustomType
A type declared inside a Diplomat-annotated module.
DocType
Lifetime
A lifetime, analogous to [syn::Lifetime].
LifetimeOrigin
MarkdownStyle
The type of markdown generated by Docs::to_markdown()
ModSymbol
A symbol declared in a module, which can either be a pointer to another path, or a custom type defined directly inside that module
Mutability
PrimitiveType
A built-in Rust primitive scalar type.
RustLinkDisplay
StringEncoding
TypeName
A local type reference, such as the type of a field, parameter, or return value. Unlike CustomType, which represents a type declaration, TypeNames can compose types through references and boxing, and can also capture unresolved paths.