pub struct TargetPlatform {
pub os: OsKind,
pub arch: ArchKind,
pub os_version: Option<String>,
}Expand description
Platform a service targets. None on ServiceSpec.platform means
“any agent is acceptable” (preserves backward compatibility).
Fields§
§os: OsKind§arch: ArchKind§os_version: Option<String>Optional OS version constraint — primarily for Windows multi-platform
images, where platform.os.version in the OCI index distinguishes build
families (e.g. 10.0.26100.* for Server 2025 / Win11 24H2,
10.0.20348.* for Server 2022). When set on a Windows target the
registry platform resolver prefers manifest entries whose os.version
matches this value exactly or shares a major.minor.build prefix.
Unused on Linux/macOS platforms.
Implementations§
Source§impl TargetPlatform
impl TargetPlatform
pub const fn new(os: OsKind, arch: ArchKind) -> Self
Sourcepub fn with_os_version(self, v: impl Into<String>) -> Self
pub fn with_os_version(self, v: impl Into<String>) -> Self
Constrain the platform to a specific os.version string.
Applies to Windows targets: the registry resolver matches manifest
entries whose platform.os.version equals this value or starts with it
(treated as a major.minor.build prefix). Has no effect on Linux/macOS.
Sourcepub fn as_oci_str(self) -> String
pub fn as_oci_str(self) -> String
Canonical OCI-style string ("linux/amd64", "windows/arm64").
Does NOT include os_version — use Self::as_detailed_str when the
version matters (e.g. for error/log messages that need to distinguish
between Windows build families).
Sourcepub fn as_detailed_str(&self) -> String
pub fn as_detailed_str(&self) -> String
Like Self::as_oci_str but appends (os.version=…) when an
os_version constraint is set. Intended for diagnostics, not for
matching against manifest entries.
Trait Implementations§
Source§impl Clone for TargetPlatform
impl Clone for TargetPlatform
Source§fn clone(&self) -> TargetPlatform
fn clone(&self) -> TargetPlatform
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for TargetPlatform
impl ComposeSchema for TargetPlatform
Source§impl Debug for TargetPlatform
impl Debug for TargetPlatform
Source§impl<'de> Deserialize<'de> for TargetPlatform
impl<'de> Deserialize<'de> for TargetPlatform
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 TargetPlatform
impl Display for TargetPlatform
Source§impl Hash for TargetPlatform
impl Hash for TargetPlatform
Source§impl PartialEq for TargetPlatform
impl PartialEq for TargetPlatform
Source§impl Serialize for TargetPlatform
impl Serialize for TargetPlatform
Source§impl ToSchema for TargetPlatform
impl ToSchema for TargetPlatform
impl Eq for TargetPlatform
impl StructuralPartialEq for TargetPlatform
Auto Trait Implementations§
impl Freeze for TargetPlatform
impl RefUnwindSafe for TargetPlatform
impl Send for TargetPlatform
impl Sync for TargetPlatform
impl Unpin for TargetPlatform
impl UnsafeUnpin for TargetPlatform
impl UnwindSafe for TargetPlatform
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.