#[non_exhaustive]pub enum XattrFiltering {
AllowlistOnly,
KeepUserXattrs,
}Expand description
Controls which extended attributes FileSystem::transform_for_oci
keeps when processing a filesystem for OCI container image consistency.
Implements std::str::FromStr/std::fmt::Display by hand using
kebab-case names (allowlist-only, keep-user-xattrs) so it can be used
directly as a CLI value (e.g. via clap::value_parser!(XattrFiltering)),
and exposes Self::VARIANTS to enumerate every mode in preference
order (default first) — useful for callers that need to find which mode
produces a given digest. Behind the varlink feature it additionally
derives Serialize/Deserialize and zlink_core::introspect::Type, so
it can be used as-is as a varlink wire parameter; there it serializes as
the bare Rust variant name (e.g. "AllowlistOnly"), matching its
introspected interface schema.
This is hand-rolled rather than derived (e.g. via strum) since there
are currently only two variants; if this grows a handful more, revisit
pulling in a derive crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AllowlistOnly
Unconditionally strip all xattrs except CONTAINER_XATTR_ALLOWLIST.
This is the historical default. It can cause composefs digest
mismatches when legitimate user.* xattrs present in an image are
stripped by one composefs-rs version but not another.
KeepUserXattrs
Keep CONTAINER_XATTR_ALLOWLIST xattrs and user.* extended
attributes.
Use this when the source of the filesystem is known to only ever
contain legitimate user.* xattrs (i.e. not host-leaked xattrs from
a mounted overlayfs), so that they can be preserved across digest
recomputation.
Implementations§
Source§impl XattrFiltering
impl XattrFiltering
Sourcepub const VARIANTS: &'static [XattrFiltering]
pub const VARIANTS: &'static [XattrFiltering]
All variants, in preference order (default first).
Hand-maintained since this type is #[non_exhaustive]: add new
variants here (and to the Display/FromStr impls below) when
extending this enum.
Trait Implementations§
Source§impl Clone for XattrFiltering
impl Clone for XattrFiltering
Source§fn clone(&self) -> XattrFiltering
fn clone(&self) -> XattrFiltering
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 XattrFiltering
Source§impl Debug for XattrFiltering
impl Debug for XattrFiltering
Source§impl Default for XattrFiltering
impl Default for XattrFiltering
Source§fn default() -> XattrFiltering
fn default() -> XattrFiltering
Source§impl<'de> Deserialize<'de> for XattrFiltering
impl<'de> Deserialize<'de> for XattrFiltering
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<XattrFiltering, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<XattrFiltering, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for XattrFiltering
impl Display for XattrFiltering
impl Eq for XattrFiltering
Source§impl FromStr for XattrFiltering
impl FromStr for XattrFiltering
Source§type Err = XattrFilteringParseError
type Err = XattrFilteringParseError
Source§fn from_str(s: &str) -> Result<XattrFiltering, <XattrFiltering as FromStr>::Err>
fn from_str(s: &str) -> Result<XattrFiltering, <XattrFiltering as FromStr>::Err>
s to return a value of this type. Read moreSource§impl PartialEq for XattrFiltering
impl PartialEq for XattrFiltering
Source§impl Serialize for XattrFiltering
impl Serialize for XattrFiltering
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for XattrFiltering
Auto Trait Implementations§
impl Freeze for XattrFiltering
impl RefUnwindSafe for XattrFiltering
impl Send for XattrFiltering
impl Sync for XattrFiltering
impl Unpin for XattrFiltering
impl UnsafeUnpin for XattrFiltering
impl UnwindSafe for XattrFiltering
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
Source§impl<S> CanonJsonSerialize for Swhere
S: Serialize,
impl<S> CanonJsonSerialize for Swhere
S: Serialize,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more