#[non_exhaustive]pub enum GpkgVersion {
V1_0,
V1_1,
V1_2,
V1_3,
V1_4,
}Expand description
GeoPackage specification version, as declared by a file’s pragmas.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V1_0
GeoPackage 1.0 (application_id “GP10”).
V1_1
GeoPackage 1.1 (application_id “GP11”).
V1_2
GeoPackage 1.2.x (user_version 102xx).
V1_3
GeoPackage 1.3.x (user_version 103xx).
V1_4
GeoPackage 1.4.x (user_version 104xx).
Implementations§
Source§impl GpkgVersion
impl GpkgVersion
Sourcepub fn from_pragmas(application_id: u32, user_version: u32) -> Option<Self>
pub fn from_pragmas(application_id: u32, user_version: u32) -> Option<Self>
Classifies a file from its application_id and user_version pragmas.
Returns None if the pragmas do not identify a GeoPackage.
user_version values above the newest known 104xx range map to
V1_4, because the spec says clients should attempt to read newer minor
versions.
§Examples
use geopackage_core::GpkgVersion;
use geopackage_core::version::APPLICATION_ID_GPKG;
let version = GpkgVersion::from_pragmas(APPLICATION_ID_GPKG, 10400);
assert_eq!(version, Some(GpkgVersion::V1_4));Sourcepub fn user_version(self) -> Option<u32>
pub fn user_version(self) -> Option<u32>
Returns the user_version this crate writes for the given version, or
None for 1.0 and 1.1, which predate user_version use.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Returns the version as written in the specification, such as "1.4".
The patch level is not included. user_version records it, but the
classification drops it: a user_version of 10401 and one of 10400
both classify as Self::V1_4.