pub struct Cache {
pub id: Option<String>,
pub target: String,
pub readonly: Option<bool>,
pub sharing: Option<CacheSharing>,
pub from: FromContext,
pub source: Option<String>,
pub chmod: Option<String>,
pub chown: Option<User>,
}
Expand description
Represents a cache definition during a run See https://docs.docker.com/reference/dockerfile/#run—mounttypecache
Fields§
§id: Option<String>
The id of the cache This is used to share the cache between different stages
target: String
The target path of the cache
readonly: Option<bool>
Defines if the cache is readonly
sharing: Option<CacheSharing>
The sharing strategy of the cache
from: FromContext
Build stage, context, or image name to use as a base of the cache mount. Defaults to empty directory.
source: Option<String>
Subpath in the from to mount. Defaults to the root of the from
chmod: Option<String>
The permissions of the cache
chown: Option<User>
The user and group that own the cache
Trait Implementations§
Source§impl From<CachePatch> for Cache
impl From<CachePatch> for Cache
Source§fn from(value: CachePatch) -> Self
fn from(value: CachePatch) -> Self
Converts to this type from the input type.
Source§impl From<ParsableStruct<CachePatch>> for Cache
impl From<ParsableStruct<CachePatch>> for Cache
Source§fn from(value: ParsableStruct<CachePatch>) -> Self
fn from(value: ParsableStruct<CachePatch>) -> Self
Converts to this type from the input type.
Source§impl Patch<CachePatch> for Cache
impl Patch<CachePatch> for Cache
Source§fn apply(&mut self, patch: CachePatch)
fn apply(&mut self, patch: CachePatch)
Apply a patch
Source§fn into_patch(self) -> CachePatch
fn into_patch(self) -> CachePatch
Returns a patch that when applied turns any struct of the same type into
Self
Source§fn into_patch_by_diff(self, previous_struct: Self) -> CachePatch
fn into_patch_by_diff(self, previous_struct: Self) -> CachePatch
Returns a patch that when applied turns
previous_struct
into Self
Source§fn new_empty_patch() -> CachePatch
fn new_empty_patch() -> CachePatch
Get an empty patch instance
Source§impl Patch<ParsableStruct<CachePatch>> for Cache
impl Patch<ParsableStruct<CachePatch>> for Cache
Source§fn apply(&mut self, patch: ParsableStruct<CachePatch>)
fn apply(&mut self, patch: ParsableStruct<CachePatch>)
Apply a patch
Source§fn into_patch(self) -> ParsableStruct<CachePatch>
fn into_patch(self) -> ParsableStruct<CachePatch>
Returns a patch that when applied turns any struct of the same type into
Self
Source§fn into_patch_by_diff(self, previous_struct: Self) -> ParsableStruct<CachePatch>
fn into_patch_by_diff(self, previous_struct: Self) -> ParsableStruct<CachePatch>
Returns a patch that when applied turns
previous_struct
into Self
Source§fn new_empty_patch() -> ParsableStruct<CachePatch>
fn new_empty_patch() -> ParsableStruct<CachePatch>
Get an empty patch instance
impl StructuralPartialEq for Cache
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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