Trait GenerateSignature

Source
pub trait GenerateSignature: Debug + Clone {
    // Required method
    fn generate_signature_with_opts(&self, opts: &SignatureOptions) -> String;

    // Provided method
    fn generate_signature(&self) -> String { ... }
}
Expand description

A trait to generate a textual “signature” (or declaration line(s)) for different AST nodes (Fn, Struct, Enum, etc.), possibly with doc lines, etc.

Required Methods§

Source

fn generate_signature_with_opts(&self, opts: &SignatureOptions) -> String

Flexible entry point: generate signature with the given options.

Provided Methods§

Source

fn generate_signature(&self) -> String

Default convenience wrapper: generate signature with fully expanded detail & doc lines.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl GenerateSignature for Enum

Source§

impl GenerateSignature for Fn

Source§

impl GenerateSignature for MacroCall

Source§

impl GenerateSignature for MacroRules

Source§

impl GenerateSignature for Struct

Source§

impl GenerateSignature for Trait

Source§

impl GenerateSignature for TypeAlias

Implementors§