pub struct RgenConfig {
pub templates_dir: Option<String>,
pub base: Option<String>,
pub prefixes: BTreeMap<String, String>,
pub rdf: Option<RdfConfig>,
}Fields§
§templates_dir: Option<String>Templates directory (relative to config file)
base: Option<String>Base IRI for RDF operations
prefixes: BTreeMap<String, String>Global prefixes for RDF operations
rdf: Option<RdfConfig>RDF configuration
Implementations§
Source§impl RgenConfig
impl RgenConfig
Sourcepub fn discover_and_load(start_dir: &Path) -> Result<Option<(Self, PathBuf)>>
pub fn discover_and_load(start_dir: &Path) -> Result<Option<(Self, PathBuf)>>
Load rgen.toml from the given directory, walking up the tree
Sourcepub fn load_from_file(config_path: &Path) -> Result<Self>
pub fn load_from_file(config_path: &Path) -> Result<Self>
Load rgen.toml from a specific file
Sourcepub fn resolve_path(&self, config_dir: &Path, path: &str) -> PathBuf
pub fn resolve_path(&self, config_dir: &Path, path: &str) -> PathBuf
Resolve a path relative to the config file directory
Sourcepub fn templates_dir_path(&self, config_dir: &Path) -> PathBuf
pub fn templates_dir_path(&self, config_dir: &Path) -> PathBuf
Get templates directory path, resolved relative to config file
Sourcepub fn rdf_file_paths(&self, config_dir: &Path) -> Vec<PathBuf>
pub fn rdf_file_paths(&self, config_dir: &Path) -> Vec<PathBuf>
Get RDF file paths, resolved relative to config file
Sourcepub fn rdf_inline_content(&self) -> Vec<String>
pub fn rdf_inline_content(&self) -> Vec<String>
Get inline RDF content
Trait Implementations§
Source§impl Clone for RgenConfig
impl Clone for RgenConfig
Source§fn clone(&self) -> RgenConfig
fn clone(&self) -> RgenConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RgenConfig
impl Debug for RgenConfig
Source§impl Default for RgenConfig
impl Default for RgenConfig
Source§impl<'de> Deserialize<'de> for RgenConfig
impl<'de> Deserialize<'de> for RgenConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RgenConfig
impl RefUnwindSafe for RgenConfig
impl Send for RgenConfig
impl Sync for RgenConfig
impl Unpin for RgenConfig
impl UnwindSafe for RgenConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more