pub struct Reference { /* private fields */ }Expand description
Represents an OCI-compliant image reference.
This struct includes the registry, repository, and a selector that combines a tag and an optional digest. If no registry or tag is provided in the input string, default values will be used.
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn get_registry(&self) -> &String
pub fn get_registry(&self) -> &String
The registry where the image is hosted.
Sourcepub fn get_repository(&self) -> &String
pub fn get_repository(&self) -> &String
The repository name of the image.
Sourcepub fn get_selector(&self) -> &ReferenceSelector
pub fn get_selector(&self) -> &ReferenceSelector
The selector specifying either a tag and an optional digest, or a digest only.
Source§impl Reference
impl Reference
Sourcepub fn set_registry(&mut self, val: String) -> &mut Self
pub fn set_registry(&mut self, val: String) -> &mut Self
The registry where the image is hosted.
Sourcepub fn set_repository(&mut self, val: String) -> &mut Self
pub fn set_repository(&mut self, val: String) -> &mut Self
The repository name of the image.
Sourcepub fn set_selector(&mut self, val: ReferenceSelector) -> &mut Self
pub fn set_selector(&mut self, val: ReferenceSelector) -> &mut Self
The selector specifying either a tag and an optional digest, or a digest only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
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 FromStr for Reference
impl FromStr for Reference
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a string slice into an OCI image Reference.
Supported formats include:
- “registry/repository:tag”
- “repository:tag”
- “repository”
- “registry/repository@digest”
- “registry/repository:tag@digest”
If the registry is omitted, it defaults to the value from [get_oci_registry].
If the tag is omitted, it defaults to DEFAULT_OCI_REFERENCE_TAG.
§Returns
Returns a MicrosandboxError::ImageReferenceError for parse failures.
Source§type Err = MicrosandboxError
type Err = MicrosandboxError
impl Eq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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<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.