#[non_exhaustive]pub enum BmopfSchemaVersion {
Bmopf010,
Bmopf020,
}Expand description
The BMOPF schema version a document is read as or written against.
A schema version fixes which element classes exist and where they live.
0.1.0 declares the ten element classes and four transformer subtypes the
historical baseline contains, sets additionalProperties: false on every
object, and permits free-form extras and meta.provenance; the classes outside it
travel there. 0.2.0 declares those classes at the top level and gives the
transformer taps, winding neutral impedance, and no load admittance their
own slots. Unsupported malformed records still require diagnostics.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bmopf010
Schema 0.1.0, the historical baseline.
Bmopf020
Schema 0.2.0, the proposal in https://github.com/distribution-system-opt/dsopt-schema. The default output version, because it states every class the model carries.
Implementations§
Source§impl BmopfSchemaVersion
impl BmopfSchemaVersion
Sourcepub const fn version(self) -> &'static str
pub const fn version(self) -> &'static str
The schema version string, as meta.schema_version states it.
Sourcepub const fn schema_id(self) -> &'static str
pub const fn schema_id(self) -> &'static str
The canonical $id of the schema document, independent of retrieval revision.
Sourcepub const fn retrieval_url(self) -> &'static str
pub const fn retrieval_url(self) -> &'static str
Retrieval URL for the exact schema archived by PowerIO.
Sourcepub fn from_schema_id(id: &str) -> Option<Self>
pub fn from_schema_id(id: &str) -> Option<Self>
The version a meta.$schema value names, or None when it names none.
A released schema document carries its version in its own $id, so the
version is the directory the schema document sits in. Documents written
before the schema moved to its own repository name the draft schema of
the bmopf-report repository, which only ever held 0.1.0, so those
locations resolve to 0.1.0 whatever shape they take. A location naming
neither answers None rather than choosing a version.
Trait Implementations§
Source§impl Clone for BmopfSchemaVersion
impl Clone for BmopfSchemaVersion
Source§fn clone(&self) -> BmopfSchemaVersion
fn clone(&self) -> BmopfSchemaVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BmopfSchemaVersion
Source§impl Debug for BmopfSchemaVersion
impl Debug for BmopfSchemaVersion
Source§impl Default for BmopfSchemaVersion
impl Default for BmopfSchemaVersion
Source§fn default() -> BmopfSchemaVersion
fn default() -> BmopfSchemaVersion
Source§impl<'de> Deserialize<'de> for BmopfSchemaVersion
impl<'de> Deserialize<'de> for BmopfSchemaVersion
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>,
impl Eq for BmopfSchemaVersion
Source§impl JsonSchema for BmopfSchemaVersion
impl JsonSchema for BmopfSchemaVersion
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for BmopfSchemaVersion
impl PartialEq for BmopfSchemaVersion
Source§fn eq(&self, other: &BmopfSchemaVersion) -> bool
fn eq(&self, other: &BmopfSchemaVersion) -> bool
self and other values to be equal, and is used by ==.