Struct Generator

Source
pub struct Generator<'a> {
    pub resolver: &'a Resolver,
    pub documentation: &'a Documentation,
    pub markdown_options: Options,
    pub opening_comment: bool,
}
Expand description

Holds the information necessary to generate the output files.

This is used by structures implementing Callbacks.

Fields§

§resolver: &'a Resolver

Used to resolve links.

§documentation: &'a Documentation

Holds the crate’s documentation.

§markdown_options: Options

Enabled markdown options

§opening_comment: bool

Control if an opening comment with meta-information should ba added to generated files.

See ConfigFile::opening_comment

Implementations§

Source§

impl<'a> Generator<'a>

Source

pub fn generate_root_file( &self, extension: &str, callbacks: &mut dyn Callbacks, ) -> String

Generate the root documentation file of the crate.

The following will be generated (in markdown style):

<crate documentation>

# Classes:

<list of GDNative classes>

This then uses Callbacks::encode to encode this in the target format.

Source

pub fn generate_file( &self, name: &str, class: &GdnativeClass, callbacks: &mut dyn Callbacks, ) -> String

Generate the documentation for a class.

The following will be generated (in markdown style):

# <class name>

**Inherit:** <inherited class>

## Description

<class documentation>

## Properties

<table of class properties>

## Methods

<table of class methods>

## Properties Descriptions

<list of the class properties with their documentation>

## Methods Descriptions

<list of the class methods with their documentation>

This then uses Callbacks::encode to encode this in the target format.

Trait Implementations§

Source§

impl<'a> Debug for Generator<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Generator<'a>

§

impl<'a> RefUnwindSafe for Generator<'a>

§

impl<'a> Send for Generator<'a>

§

impl<'a> Sync for Generator<'a>

§

impl<'a> Unpin for Generator<'a>

§

impl<'a> UnwindSafe for Generator<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.