#[non_exhaustive]pub struct ParserInfo {
pub name: String,
pub version: String,
pub schema: u32,
}Expand description
Which parser made a skeleton: the crate name, its version (for information) and the skeleton schema number.
The schema is an integer each format crate bumps only when its skeleton layout changes, so a new crate release
that did not touch the layout still merges old skeletons (see check_parser).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe producing crate, e.g. “bilingua-docx”.
version: StringIts semver version, e.g. “0.1.0”. Informational only; never compared.
schema: u32The skeleton schema number. Absent in stamps written before schemas existed, which read as schema 1.
Implementations§
Source§impl ParserInfo
impl ParserInfo
Sourcepub fn new(
name: impl Into<String>,
version: impl Into<String>,
schema: u32,
) -> ParserInfo
pub fn new( name: impl Into<String>, version: impl Into<String>, schema: u32, ) -> ParserInfo
A stamp for this crate name, version and skeleton schema (usually written parser_info!()).
Sourcepub fn compatible_with(&self, current: &ParserInfo) -> bool
pub fn compatible_with(&self, current: &ParserInfo) -> bool
True when a skeleton made by self can be read by current: same crate and a schema no newer than the
current one.
Trait Implementations§
Source§impl Clone for ParserInfo
impl Clone for ParserInfo
Source§impl Debug for ParserInfo
impl Debug for ParserInfo
Source§impl<'de> Deserialize<'de> for ParserInfo
impl<'de> Deserialize<'de> for ParserInfo
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
impl Eq for ParserInfo
Source§impl PartialEq for ParserInfo
impl PartialEq for ParserInfo
Source§impl Serialize for ParserInfo
impl Serialize for ParserInfo
impl StructuralPartialEq for ParserInfo
Auto Trait Implementations§
impl Forget for ParserInfo
impl Freeze for ParserInfo
impl RefUnwindSafe for ParserInfo
impl Send for ParserInfo
impl Sync for ParserInfo
impl Unpin for ParserInfo
impl UnsafeUnpin for ParserInfo
impl UnwindSafe for ParserInfo
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