pub struct FormatVersion {
pub major: u16,
pub minor: u16,
}Expand description
The format version of an IR file.
Breaking changes bump the major, backward-compatible additions the minor.
Readers accept any minor of SUPPORTED_MAJOR and ignore fields they
don’t know.
Fields§
§major: u16The major version. Incompatible changes increment it.
minor: u16The minor version. Backward-compatible additions increment it.
Implementations§
Source§impl FormatVersion
impl FormatVersion
Sourcepub const CURRENT: FormatVersion
pub const CURRENT: FormatVersion
The version this crate writes: SUPPORTED_MAJOR.CURRENT_MINOR.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns whether this crate can read a file of this version, i.e. whether
its major is SUPPORTED_MAJOR.
Trait Implementations§
Source§impl Clone for FormatVersion
impl Clone for FormatVersion
Source§fn clone(&self) -> FormatVersion
fn clone(&self) -> FormatVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FormatVersion
Source§impl Debug for FormatVersion
impl Debug for FormatVersion
Source§impl<'de> Deserialize<'de> for FormatVersion
impl<'de> Deserialize<'de> for FormatVersion
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 FormatVersion
Source§impl JsonSchema for FormatVersion
impl JsonSchema for FormatVersion
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for FormatVersion
impl PartialEq for FormatVersion
Source§impl Serialize for FormatVersion
impl Serialize for FormatVersion
impl StructuralPartialEq for FormatVersion
Auto Trait Implementations§
impl Freeze for FormatVersion
impl RefUnwindSafe for FormatVersion
impl Send for FormatVersion
impl Sync for FormatVersion
impl Unpin for FormatVersion
impl UnsafeUnpin for FormatVersion
impl UnwindSafe for FormatVersion
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