pub struct NameMappings {
pub shared: ModuleMappings,
pub sml: ModuleMappings,
pub wml: ModuleMappings,
pub pml: ModuleMappings,
pub dml: ModuleMappings,
}Expand description
Complete name mappings file structure.
Fields§
Shared mappings applied to all modules.
sml: ModuleMappingsSpreadsheetML mappings.
wml: ModuleMappingsWordprocessingML mappings.
pml: ModuleMappingsPresentationML mappings.
dml: ModuleMappingsDrawingML mappings.
Implementations§
Source§impl NameMappings
impl NameMappings
Sourcepub fn from_yaml_file(path: &Path) -> Result<Self, Box<dyn Error>>
pub fn from_yaml_file(path: &Path) -> Result<Self, Box<dyn Error>>
Load mappings from a YAML file.
Sourcepub fn for_module(&self, module: &str) -> &ModuleMappings
pub fn for_module(&self, module: &str) -> &ModuleMappings
Get the module mappings for a given module name.
Sourcepub fn resolve_type(&self, module: &str, spec_name: &str) -> Option<&str>
pub fn resolve_type(&self, module: &str, spec_name: &str) -> Option<&str>
Resolve a type name, checking module-specific then shared mappings.
Sourcepub fn resolve_field(&self, module: &str, spec_name: &str) -> Option<&str>
pub fn resolve_field(&self, module: &str, spec_name: &str) -> Option<&str>
Resolve a field name, checking module-specific then shared mappings.
Trait Implementations§
Source§impl Clone for NameMappings
impl Clone for NameMappings
Source§fn clone(&self) -> NameMappings
fn clone(&self) -> NameMappings
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 NameMappings
impl Debug for NameMappings
Source§impl Default for NameMappings
impl Default for NameMappings
Source§fn default() -> NameMappings
fn default() -> NameMappings
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NameMappings
impl<'de> Deserialize<'de> for NameMappings
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 NameMappings
impl RefUnwindSafe for NameMappings
impl Send for NameMappings
impl Sync for NameMappings
impl Unpin for NameMappings
impl UnsafeUnpin for NameMappings
impl UnwindSafe for NameMappings
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