pub struct RawDbdFile {
pub name: String,
pub columns: HashMap<String, RawColumn>,
pub definitions: Vec<RawDefinition>,
}
Expand description
An entire .dbd
file with all subtypes.
Use RawDbdFile::into_proper
to get a more ergonomic API.
use RawDbdFile::specific_version
to find the definition that is valid for that specific version.
Fields§
§name: String
Name of the dbd
file, including .dbd
.
Can not be assumed to always be correct since load_file_from_string
can provide an invalid name.
columns: HashMap<String, RawColumn>
Column definitions found under COLUMNS
.
definitions: Vec<RawDefinition>
Individual definitions, including versioning and layouts.
Implementations§
Source§impl RawDbdFile
impl RawDbdFile
Sourcepub fn specific_version(&self, version: &Version) -> Option<&RawDefinition>
pub fn specific_version(&self, version: &Version) -> Option<&RawDefinition>
Finds the definition for a specific version, if it exists.
Sourcepub fn into_proper(self) -> Result<DbdFile, ConversionError>
pub fn into_proper(self) -> Result<DbdFile, ConversionError>
Converts the raw file into a more ergonomic Rust API.
Can fail if the dbd
file does invalid things.
§Errors
Errors if the file does not uphold the invariants described in ConversionError
.
Sourcepub fn find_column(&self, entry: &RawEntry) -> Option<&RawColumn>
pub fn find_column(&self, entry: &RawEntry) -> Option<&RawColumn>
Find the corresponding column for an entry.
Trait Implementations§
Source§impl Clone for RawDbdFile
impl Clone for RawDbdFile
Source§fn clone(&self) -> RawDbdFile
fn clone(&self) -> RawDbdFile
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RawDbdFile
impl Debug for RawDbdFile
Source§impl PartialEq for RawDbdFile
impl PartialEq for RawDbdFile
impl Eq for RawDbdFile
impl StructuralPartialEq for RawDbdFile
Auto Trait Implementations§
impl Freeze for RawDbdFile
impl RefUnwindSafe for RawDbdFile
impl Send for RawDbdFile
impl Sync for RawDbdFile
impl Unpin for RawDbdFile
impl UnwindSafe for RawDbdFile
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