Converts a [`SchemaVersion`] to a [`SourceInfoSchema`]. # Errors Returns an error if the [`SchemaVersion`]'s inner [`Version`] does not provide a major version that corresponds to a [`SourceInfoSchema`] variant.
(value: SchemaVersion)
| 162 | /// Returns an error if the [`SchemaVersion`]'s inner [`Version`] does not provide a major |
| 163 | /// version that corresponds to a [`SourceInfoSchema`] variant. |
| 164 | fn try_from(value: SchemaVersion) -> Result<Self, Self::Error> { |
| 165 | match value.inner().major { |
| 166 | 1 => Ok(SourceInfoSchema::V1(value)), |
| 167 | _ => Err(Error::UnsupportedSchemaVersion(value.to_string())), |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | impl Display for SourceInfoSchema { |