Struct oci_spec::image::Descriptor
source · pub struct Descriptor { /* private fields */ }
Expand description
A Content Descriptor (or simply Descriptor) describes the disposition of the targeted content. It includes the type of the content, a content identifier (digest), and the byte-size of the raw content. Descriptors SHOULD be embedded in other formats to securely reference external content.
Implementations§
source§impl Descriptor
impl Descriptor
sourcepub fn size(&self) -> i64
pub fn size(&self) -> i64
This REQUIRED property specifies the size, in bytes, of the raw content. This property exists so that a client will have an expected size for the content before processing. If the length of the retrieved content does not match the specified length, the content SHOULD NOT be trusted.
source§impl Descriptor
impl Descriptor
sourcepub fn media_type(&self) -> &MediaType
pub fn media_type(&self) -> &MediaType
This REQUIRED property contains the media type of the referenced content. Values MUST comply with RFC 6838, including the naming requirements in its section 4.2.
sourcepub fn digest(&self) -> &String
pub fn digest(&self) -> &String
This REQUIRED property is the digest of the targeted content, conforming to the requirements outlined in Digests. Retrieved content SHOULD be verified against this digest when consumed via untrusted sources.
sourcepub fn annotations(&self) -> &Option<HashMap<String, String>>
pub fn annotations(&self) -> &Option<HashMap<String, String>>
This OPTIONAL property contains arbitrary metadata for this descriptor. This OPTIONAL property MUST use the annotation rules.
sourcepub fn platform(&self) -> &Option<Platform>
pub fn platform(&self) -> &Option<Platform>
This OPTIONAL property describes the minimum runtime requirements of the image. This property SHOULD be present if its target is platform-specific.
sourcepub fn artifact_type(&self) -> &Option<MediaType>
pub fn artifact_type(&self) -> &Option<MediaType>
This OPTIONAL property contains the type of an artifact when the descriptor points to an artifact. This is the value of the config descriptor mediaType when the descriptor references an image manifest. If defined, the value MUST comply with RFC 6838, including the naming requirements in its section 4.2, and MAY be registered with IANA.
sourcepub fn data(&self) -> &Option<String>
pub fn data(&self) -> &Option<String>
This OPTIONAL property contains an embedded representation of the referenced content. Values MUST conform to the Base 64 encoding, as defined in RFC 4648. The decoded data MUST be identical to the referenced content and SHOULD be verified against the digest and size fields by content consumers. See Embedded Content for when this is appropriate.
source§impl Descriptor
impl Descriptor
sourcepub fn set_media_type(&mut self, val: MediaType) -> &mut Self
pub fn set_media_type(&mut self, val: MediaType) -> &mut Self
This REQUIRED property contains the media type of the referenced content. Values MUST comply with RFC 6838, including the naming requirements in its section 4.2.
sourcepub fn set_digest(&mut self, val: String) -> &mut Self
pub fn set_digest(&mut self, val: String) -> &mut Self
This REQUIRED property is the digest of the targeted content, conforming to the requirements outlined in Digests. Retrieved content SHOULD be verified against this digest when consumed via untrusted sources.
sourcepub fn set_size(&mut self, val: i64) -> &mut Self
pub fn set_size(&mut self, val: i64) -> &mut Self
This REQUIRED property specifies the size, in bytes, of the raw content. This property exists so that a client will have an expected size for the content before processing. If the length of the retrieved content does not match the specified length, the content SHOULD NOT be trusted.
sourcepub fn set_annotations(
&mut self,
val: Option<HashMap<String, String>>,
) -> &mut Self
pub fn set_annotations( &mut self, val: Option<HashMap<String, String>>, ) -> &mut Self
This OPTIONAL property contains arbitrary metadata for this descriptor. This OPTIONAL property MUST use the annotation rules.
sourcepub fn set_platform(&mut self, val: Option<Platform>) -> &mut Self
pub fn set_platform(&mut self, val: Option<Platform>) -> &mut Self
This OPTIONAL property describes the minimum runtime requirements of the image. This property SHOULD be present if its target is platform-specific.
sourcepub fn set_artifact_type(&mut self, val: Option<MediaType>) -> &mut Self
pub fn set_artifact_type(&mut self, val: Option<MediaType>) -> &mut Self
This OPTIONAL property contains the type of an artifact when the descriptor points to an artifact. This is the value of the config descriptor mediaType when the descriptor references an image manifest. If defined, the value MUST comply with RFC 6838, including the naming requirements in its section 4.2, and MAY be registered with IANA.
sourcepub fn set_data(&mut self, val: Option<String>) -> &mut Self
pub fn set_data(&mut self, val: Option<String>) -> &mut Self
This OPTIONAL property contains an embedded representation of the referenced content. Values MUST conform to the Base 64 encoding, as defined in RFC 4648. The decoded data MUST be identical to the referenced content and SHOULD be verified against the digest and size fields by content consumers. See Embedded Content for when this is appropriate.
Trait Implementations§
source§impl Clone for Descriptor
impl Clone for Descriptor
source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Descriptor
impl Debug for Descriptor
source§impl<'de> Deserialize<'de> for Descriptor
impl<'de> Deserialize<'de> for Descriptor
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 PartialEq for Descriptor
impl PartialEq for Descriptor
source§fn eq(&self, other: &Descriptor) -> bool
fn eq(&self, other: &Descriptor) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Descriptor
impl Serialize for Descriptor
impl Eq for Descriptor
impl StructuralPartialEq for Descriptor
Auto Trait Implementations§
impl Freeze for Descriptor
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnwindSafe for Descriptor
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)