Struct oci_distribution::client::ImageLayer
source · pub struct ImageLayer {
pub data: Vec<u8>,
pub media_type: String,
pub annotations: Option<HashMap<String, String>>,
}
Expand description
The data and media type for an image layer
Fields§
§data: Vec<u8>
The data of this layer
media_type: String
The media type of this layer
annotations: Option<HashMap<String, String>>
This OPTIONAL property contains arbitrary metadata for this descriptor. This OPTIONAL property MUST use the annotation rules
Implementations§
source§impl ImageLayer
impl ImageLayer
sourcepub fn new(
data: Vec<u8>,
media_type: String,
annotations: Option<HashMap<String, String>>
) -> Self
pub fn new( data: Vec<u8>, media_type: String, annotations: Option<HashMap<String, String>> ) -> Self
Constructs a new ImageLayer struct with provided data and media type
sourcepub fn oci_v1(
data: Vec<u8>,
annotations: Option<HashMap<String, String>>
) -> Self
pub fn oci_v1( data: Vec<u8>, annotations: Option<HashMap<String, String>> ) -> Self
Constructs a new ImageLayer struct with provided data and media type application/vnd.oci.image.layer.v1.tar
sourcepub fn oci_v1_gzip(
data: Vec<u8>,
annotations: Option<HashMap<String, String>>
) -> Self
pub fn oci_v1_gzip( data: Vec<u8>, annotations: Option<HashMap<String, String>> ) -> Self
Constructs a new ImageLayer struct with provided data and media type application/vnd.oci.image.layer.v1.tar+gzip
sourcepub fn sha256_digest(&self) -> String
pub fn sha256_digest(&self) -> String
Helper function to compute the sha256 digest of an image layer
Trait Implementations§
source§impl Clone for ImageLayer
impl Clone for ImageLayer
source§fn clone(&self) -> ImageLayer
fn clone(&self) -> ImageLayer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ImageLayer
impl RefUnwindSafe for ImageLayer
impl Send for ImageLayer
impl Sync for ImageLayer
impl Unpin for ImageLayer
impl UnwindSafe for ImageLayer
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
Mutably borrows from an owned value. Read more