pub struct RawDefinitionV0 {
pub xsd_element: Vec<Element>,
}Expand description
Version 0 (Empire/Napoleon) XSD schema root structure.
Empire and Napoleon use .xsd XML Schema Definition files instead of
the TWaD_ format used in later games. This struct represents the root
of such a schema file.
Fields§
§xsd_element: Vec<Element>XSD elements defining the table structure.
Implementations§
Source§impl RawDefinitionV0
impl RawDefinitionV0
Sourcepub fn read(raw_definition_path: &Path) -> Result<Option<Self>>
pub fn read(raw_definition_path: &Path) -> Result<Option<Self>>
Parses a Version 0 (Empire/Napoleon) XSD schema file.
Reads and parses an XSD (XML Schema Definition) file from the Empire or
Napoleon Assembly Kit. The XSD format is significantly different from the
TWaD_ format used in later games.
§Arguments
raw_definition_path- Path to the.xsdfile
§Returns
Returns Ok(Some(definition)) if the file was parsed successfully, Ok(None)
if the file was empty, or an error if parsing failed.
§Errors
Returns an error if:
- The file cannot be opened (returns
RLibError::AssemblyKitNotFound) - The XML/XSD is malformed
§Implementation Note
Due to limitations in serde_xml_rs, this function performs extensive string
replacements on the XSD content before parsing to normalize XML namespace
prefixes (xsd: and xs: → xsd_, od: → od_).
Trait Implementations§
Source§impl Clone for RawDefinitionV0
impl Clone for RawDefinitionV0
Source§fn clone(&self) -> RawDefinitionV0
fn clone(&self) -> RawDefinitionV0
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawDefinitionV0
impl Debug for RawDefinitionV0
Source§impl Default for RawDefinitionV0
impl Default for RawDefinitionV0
Source§fn default() -> RawDefinitionV0
fn default() -> RawDefinitionV0
Source§impl<'de> Deserialize<'de> for RawDefinitionV0
impl<'de> Deserialize<'de> for RawDefinitionV0
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>,
Source§impl From<&RawDefinitionV0> for RawDefinition
Old games don’t use references, but rather indexes like a database. This means we’re unable to find
the referenced column without having the reference definition. So ref data needs to be calculated after this.
impl From<&RawDefinitionV0> for RawDefinition
Old games don’t use references, but rather indexes like a database. This means we’re unable to find the referenced column without having the reference definition. So ref data needs to be calculated after this.
Source§fn from(value: &RawDefinitionV0) -> Self
fn from(value: &RawDefinitionV0) -> Self
Auto Trait Implementations§
impl Freeze for RawDefinitionV0
impl RefUnwindSafe for RawDefinitionV0
impl Send for RawDefinitionV0
impl Sync for RawDefinitionV0
impl Unpin for RawDefinitionV0
impl UnsafeUnpin for RawDefinitionV0
impl UnwindSafe for RawDefinitionV0
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.