pub struct WorkerDistribution { /* private fields */ }Expand description
Trusted macOS worker provisioning policy.
Implementations§
Source§impl WorkerDistribution
impl WorkerDistribution
Sourcepub fn new(
download_url: impl Into<String>,
sha256: impl Into<String>,
version: impl Into<String>,
) -> Result<Self, WorkflowConfigError>
pub fn new( download_url: impl Into<String>, sha256: impl Into<String>, version: impl Into<String>, ) -> Result<Self, WorkflowConfigError>
Validate one public GitHub release asset, SHA-256, and worker version.
The URL must be a simple HTTPS GitHub release URL without credentials, a query, a fragment, percent escapes, or shell/YAML metacharacters.
§Errors
Rejects a non-GitHub/non-HTTPS URL, malformed lowercase SHA-256, or an unsafe version label.
Sourcepub fn from_source(
repository: impl Into<String>,
revision: impl Into<String>,
expected_version: impl Into<String>,
) -> Result<Self, WorkflowConfigError>
pub fn from_source( repository: impl Into<String>, revision: impl Into<String>, expected_version: impl Into<String>, ) -> Result<Self, WorkflowConfigError>
Bind a source build to one normalized GitHub repository, exact commit, and expected semantic version.
Repository inputs may be OWNER/REPOSITORY or an HTTPS GitHub URL,
optionally ending in .git or /. The stored URL and slug are
lowercase and contain exactly two path components.
§Errors
Rejects non-GitHub repositories, malformed 40-character lowercase commit IDs, and non-canonical semantic versions.
Sourcepub fn download_url(&self) -> &str
pub fn download_url(&self) -> &str
Validated public download URL for prebuilt provisioning.
§Panics
Panics when source-build provisioning is selected. Use
Self::source_repository to inspect that mode.
Sourcepub fn sha256(&self) -> &str
pub fn sha256(&self) -> &str
Expected lowercase SHA-256 for prebuilt provisioning.
§Panics
Panics when source-build provisioning is selected. Its SHA-256 is derived by the isolated worker job and propagated as a job output.
Sourcepub fn is_source_build(&self) -> bool
pub fn is_source_build(&self) -> bool
Whether the worker is built from an exact trusted source revision.
Sourcepub fn source_repository(&self) -> Option<&str>
pub fn source_repository(&self) -> Option<&str>
Normalized HTTPS GitHub repository when source provisioning is selected.
Sourcepub fn source_revision(&self) -> Option<&str>
pub fn source_revision(&self) -> Option<&str>
Exact lowercase commit ID when source provisioning is selected.
Trait Implementations§
Source§impl Clone for WorkerDistribution
impl Clone for WorkerDistribution
Source§impl Debug for WorkerDistribution
impl Debug for WorkerDistribution
impl Eq for WorkerDistribution
Source§impl PartialEq for WorkerDistribution
impl PartialEq for WorkerDistribution
impl StructuralPartialEq for WorkerDistribution
Auto Trait Implementations§
impl Freeze for WorkerDistribution
impl RefUnwindSafe for WorkerDistribution
impl Send for WorkerDistribution
impl Sync for WorkerDistribution
impl Unpin for WorkerDistribution
impl UnsafeUnpin for WorkerDistribution
impl UnwindSafe for WorkerDistribution
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.