pub struct SourceFidelity {
pub version: String,
pub annotations: Annotations,
pub retained_records: Vec<RetainedSourceRecord>,
}Expand description
Decode-time source annotations and retained native records.
Fields§
§version: StringSerialized representation version.
annotations: AnnotationsSparse source locations and conversion exactness.
retained_records: Vec<RetainedSourceRecord>Native records retained for recovery or replay.
Implementations§
Source§impl SourceFidelity
impl SourceFidelity
Sourcepub fn retained_record(&self, id: &str) -> Option<&RetainedSourceRecord>
pub fn retained_record(&self, id: &str) -> Option<&RetainedSourceRecord>
Finds a retained source record by identifier.
Sourcepub fn retain_unknown_records(
&mut self,
stream: &str,
records: &[UnknownRecord],
)
pub fn retain_unknown_records( &mut self, stream: &str, records: &[UnknownRecord], )
Retains source records without adding them to the product model.
Sourcepub fn attach_native_unknown_records(
&mut self,
ir: &mut CadIr,
format: &str,
records: &[UnknownRecord],
) -> Result<(), NativeConvertError>
pub fn attach_native_unknown_records( &mut self, ir: &mut CadIr, format: &str, records: &[UnknownRecord], ) -> Result<(), NativeConvertError>
Stores source bytes in the sidecar and references in the product model.
Sourcepub fn native_unknown_records(
&self,
ir: &CadIr,
format: &str,
) -> Result<Vec<UnknownRecord>, NativeConvertError>
pub fn native_unknown_records( &self, ir: &CadIr, format: &str, ) -> Result<Vec<UnknownRecord>, NativeConvertError>
Joins product references with retained source records.
Sourcepub fn validate(&self) -> Result<(), FidelityError>
pub fn validate(&self) -> Result<(), FidelityError>
Validates retained record identity and payload integrity.
Sourcepub fn to_canonical_json(&self) -> Result<String, Error>
pub fn to_canonical_json(&self) -> Result<String, Error>
Serializes the canonical sidecar as compact JSON.
Sourcepub fn from_json(text: &str) -> Result<Self, SourceFidelityParseError>
pub fn from_json(text: &str) -> Result<Self, SourceFidelityParseError>
Parses and validates a sidecar.
Trait Implementations§
Source§impl Clone for SourceFidelity
impl Clone for SourceFidelity
Source§fn clone(&self) -> SourceFidelity
fn clone(&self) -> SourceFidelity
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 moreSource§impl Debug for SourceFidelity
impl Debug for SourceFidelity
Source§impl Default for SourceFidelity
impl Default for SourceFidelity
Source§impl<'de> Deserialize<'de> for SourceFidelity
impl<'de> Deserialize<'de> for SourceFidelity
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 SourceFidelity
Source§impl JsonSchema for SourceFidelity
impl JsonSchema for SourceFidelity
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 SourceFidelity
impl PartialEq for SourceFidelity
Source§impl Serialize for SourceFidelity
impl Serialize for SourceFidelity
impl StructuralPartialEq for SourceFidelity
Auto Trait Implementations§
impl Freeze for SourceFidelity
impl RefUnwindSafe for SourceFidelity
impl Send for SourceFidelity
impl Sync for SourceFidelity
impl Unpin for SourceFidelity
impl UnsafeUnpin for SourceFidelity
impl UnwindSafe for SourceFidelity
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