Trait gdnative_doc::backend::Callbacks[][src]

pub trait Callbacks {
    fn extension(&self) -> &'static str;
fn generate_files(
        &mut self,
        generator: Generator<'_>
    ) -> HashMap<String, String>;
fn encode(&mut self, s: &mut String, events: Vec<Event<'_>>); fn start_method(
        &mut self,
        _s: &mut String,
        _resolver: &Resolver,
        _method: &Method
    ) { ... }
fn start_property(
        &mut self,
        _s: &mut String,
        _resolver: &Resolver,
        _property: &Property
    ) { ... } }

Callbacks to encode markdown input in a given format.

This trait should be implemented if you want to make your own backend.

Required methods

fn extension(&self) -> &'static str[src]

File extension for the files generated by this callback.

fn generate_files(
    &mut self,
    generator: Generator<'_>
) -> HashMap<String, String>
[src]

Drive the generation process.

This returns a map from file names (relative to the output directory) to their contents.

You can find inspiration about how to implement this in the source code, for example in src/backend/html.rs.

fn encode(&mut self, s: &mut String, events: Vec<Event<'_>>)[src]

Encode the stream of events in s.

Loading content...

Provided methods

fn start_method(
    &mut self,
    _s: &mut String,
    _resolver: &Resolver,
    _method: &Method
)
[src]

Called before encoding each method.

Default: does nothing

fn start_property(
    &mut self,
    _s: &mut String,
    _resolver: &Resolver,
    _property: &Property
)
[src]

Called before encoding each property.

Default: does nothing

Loading content...

Implementations

impl dyn Callbacks[src]

pub fn start_method_default(
    &mut self,
    s: &mut String,
    property: &Resolver,
    method: &Method
)
[src]

Default start_method implementation, implemented on dyn Callbacks to avoid code duplication.

This will create a level 3 header that looks like (in markdown):

### <a id="func-name"></a>func name(arg1: [type](link), ...) -> [type](link)
________

With appropriate linking.

pub fn start_property_default(
    &mut self,
    s: &mut String,
    resolver: &Resolver,
    property: &Property
)
[src]

Default start_property implementation, implemented on dyn Callbacks to avoid code duplication.

This will create a level 3 header that looks like (in markdown):

### <a id="property-name"></a> name: [type](link)
________

With appropriate linking.

Trait Implementations

impl Debug for dyn Callbacks[src]

Implementors

Loading content...