#[non_exhaustive]pub struct MetadataFields {
pub icc: IccRetention,
pub exif: ExifPolicy,
pub xmp: Retention,
pub cicp: Retention,
pub hdr: Retention,
}Expand description
Per-field metadata retention for MetadataPolicy::Custom.
EXIF is encapsulated in ExifPolicy (pruned by category); the remaining
fields use Retention (explicit Keep/Discard). This type is
#[non_exhaustive] (new fields can be added without a breaking change), so
downstream crates build from KEEP_ALL /
DISCARD_ALL via the with_* builders rather than
struct-update syntax. Drop only GPS, keep all else:
use zencodec::{MetadataFields, exif::{ExifPolicy, Retention}};
let fields = MetadataFields::KEEP_ALL
.with_exif(ExifPolicy::KEEP_ALL.with_gps(Retention::Discard));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.icc: IccRetentionICC color profile.
exif: ExifPolicyEXIF, pruned by category.
xmp: RetentionXMP, whole-segment. The XMP packet (RDF/XML) can carry GPS
(exif:GPS*), edit history (photoshop:History, xmpMM:History),
and C2PA provenance (xmpMM manifests), so the presets that strip
privacy/bloat (Web) discard it wholesale while
keeping EXIF rights.
Partial XMP (e.g. keep dc:rights/dc:creator, drop GPS + history +
C2PA) is a planned future addition — it needs an RDF/XML parser, so it
is deferred rather than half-done. It will arrive as a new
MetadataFields field (this struct is #[non_exhaustive], so adding
one is non-breaking); xmp will remain the whole-segment master switch.
cicp: RetentionCICP color signaling.
hdr: RetentionHDR ContentLightLevel + MasteringDisplay.
Implementations§
Source§impl MetadataFields
impl MetadataFields
Sourcepub const DISCARD_ALL: Self
pub const DISCARD_ALL: Self
Discard every field.
Sourcepub const fn with_icc(self, r: IccRetention) -> Self
pub const fn with_icc(self, r: IccRetention) -> Self
Set ICC retention. (Builder — this type is #[non_exhaustive].)
Sourcepub const fn with_exif(self, p: ExifPolicy) -> Self
pub const fn with_exif(self, p: ExifPolicy) -> Self
Set the EXIF retention policy.
Trait Implementations§
Source§impl Clone for MetadataFields
impl Clone for MetadataFields
Source§fn clone(&self) -> MetadataFields
fn clone(&self) -> MetadataFields
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more