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>>,
}

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::read_from(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()]
);

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.

Implementations

impl ConfigFile[src]

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

Read ConfigFile from the given toml configuration file.

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.