Struct gdnative_doc::ConfigFile[][src]

pub struct ConfigFile {
    pub url_overrides: Option<HashMap<String, String>>,
    pub rename_classes: Option<HashMap<String, String>>,
    pub markdown_options: Option<Vec<String>>,
    pub opening_comment: Option<bool>,
}

Structure that holds user configuration settings.

Should be obtained via a toml configuration file.

Example

const CONFIG_FILE_CONTENT: &str = r#"
rename_classes = { RustName = "GDScriptName" }
markdown_options = ["STRIKETHROUGH", "TABLES"]
"#;

let config_file = ConfigFile::load_from_str(CONFIG_FILE_CONTENT)?;
assert!(config_file.url_overrides.is_none());
assert_eq!(config_file.rename_classes.unwrap()["RustName"], "GDScriptName");
assert_eq!(
    config_file.markdown_options.unwrap(),
    &["STRIKETHROUGH".to_string(), "TABLES".to_string()]
);

Note that if you are reading the configuration file from an on-disk file, you should prefer load_from_path.

Fields

url_overrides: Option<HashMap<String, String>>

List of items for which the linking url should be overriden.

rename_classes: Option<HashMap<String, String>>

Renaming of types when going from Rust to Godot.

This is useful because GDNative allows defining a script_class_name in the .gdns file.

markdown_options: Option<Vec<String>>

Optional markdown options.

Valid options

  • FOOTNOTES
  • SMART_PUNCTUATION
  • STRIKETHROUGH
  • TABLES
  • TASKLISTS

Default

No option enabled.

opening_comment: Option<bool>

Control whether or not to include a comment in the generated files.

The comment includes information such that the file was automatically generated, the name of the source file it originated from…

Default

true

Implementations

impl ConfigFile[src]

pub fn load_from_path(path: PathBuf) -> Result<Self>[src]

Load the config file from the given path.

pub fn load_from_str(config: &str) -> Result<Self>[src]

Load the config file from the given config string.

Trait Implementations

impl Clone for ConfigFile[src]

impl Debug for ConfigFile[src]

impl<'de> Deserialize<'de> for ConfigFile[src]

impl Eq for ConfigFile[src]

impl PartialEq<ConfigFile> for ConfigFile[src]

impl StructuralEq for ConfigFile[src]

impl StructuralPartialEq for ConfigFile[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.