pub enum DockerfileFromTarget {
Image(ImageReference),
Stage(String),
Scratch,
}Expand description
A Dockerfile FROM target.
FROM references can resolve to one of three things in a Dockerfile:
an OCI image (the common case), a previous stage in a multi-stage
build (e.g. FROM builder AS final), or the special scratch
pseudo-image. This enum captures all three. For non-Dockerfile call
sites (image registry lookups, toolchain detection, etc.) use
zlayer_types::ImageReference directly — the bare OCI ref type
without the Dockerfile-only variants.
Variants§
Image(ImageReference)
An OCI image reference (canonical OCI grammar).
Stage(String)
A reference to another stage in this multi-stage build.
Scratch
The special scratch pseudo-image.
Implementations§
Source§impl DockerfileFromTarget
impl DockerfileFromTarget
Sourcepub fn parse(s: &str) -> Self
pub fn parse(s: &str) -> Self
Parse a raw FROM target string.
Recognizes scratch (case-insensitive), then attempts an OCI
reference parse via ImageReference::from_str. If parsing
succeeds, the result is an Self::Image; otherwise the
input is treated as a Self::Stage reference.
Note that the OCI grammar accepts bare names like alpine as
valid image references, so disambiguation between an image
and a multi-stage stage reference must happen post-hoc at the
call site by consulting the set of known stage names.
Sourcepub fn is_scratch(&self) -> bool
pub fn is_scratch(&self) -> bool
Returns true if this is the scratch pseudo-image.
Trait Implementations§
Source§impl Clone for DockerfileFromTarget
impl Clone for DockerfileFromTarget
Source§fn clone(&self) -> DockerfileFromTarget
fn clone(&self) -> DockerfileFromTarget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DockerfileFromTarget
impl Debug for DockerfileFromTarget
Source§impl<'de> Deserialize<'de> for DockerfileFromTarget
impl<'de> Deserialize<'de> for DockerfileFromTarget
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>,
Source§impl Display for DockerfileFromTarget
impl Display for DockerfileFromTarget
Source§impl PartialEq for DockerfileFromTarget
impl PartialEq for DockerfileFromTarget
Source§impl Serialize for DockerfileFromTarget
impl Serialize for DockerfileFromTarget
impl Eq for DockerfileFromTarget
impl StructuralPartialEq for DockerfileFromTarget
Auto Trait Implementations§
impl Freeze for DockerfileFromTarget
impl RefUnwindSafe for DockerfileFromTarget
impl Send for DockerfileFromTarget
impl Sync for DockerfileFromTarget
impl Unpin for DockerfileFromTarget
impl UnsafeUnpin for DockerfileFromTarget
impl UnwindSafe for DockerfileFromTarget
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<C> SignWithKey<String> for Cwhere
C: ToBase64,
impl<C> SignWithKey<String> for Cwhere
C: ToBase64,
fn sign_with_key(self, key: &impl SigningAlgorithm) -> Result<String, Error>
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.