pub enum BuildInput {
AddInMemoryFile {
dst_path: Utf8PathBuf,
contents: String,
},
AddDirectory(TargetDirectory),
AddFile {
mapped_path: MappedPath,
len: u64,
},
AddBlob {
path: MappedPath,
blob: Source,
},
AddPackage(TargetPackage),
}Expand description
All possible inputs which are used to construct Omicron packages
Variants§
AddInMemoryFile
Adds a single file, which is stored in-memory.
This is mostly used as a way to cache metadata.
AddDirectory(TargetDirectory)
Add a single directory to the target archive.
This directory doesn’t need to exist on the build host.
AddFile
Add a file directly from source to target.
Fields
mapped_path: MappedPathDescribes the files being added.
len: u64The length of the file.
Q: Is this necessary? Aren’t we already storing the file itself, making this field redundant?
A: We use it to help caching, on the “known cache miss” case. In most circumstances where a file has been edited, the length changes too. Comparing u64s is significantly faster than hashing, in this situation.
AddBlob
Add a dowloaded file from source to target.
This is similar to “AddFile”, though it may require downloading an input first.
AddPackage(TargetPackage)
Add a package from source to target.
This is similar to “AddFile”, though it requires unpacking the package and re-packaging it into the target.
Implementations§
Source§impl BuildInput
impl BuildInput
Sourcepub fn input_path(&self) -> Option<&Utf8Path>
pub fn input_path(&self) -> Option<&Utf8Path>
If the input has a path on the host machine, return it.
pub fn add_file(mapped_path: MappedPath) -> Result<Self>
Trait Implementations§
Source§impl Clone for BuildInput
impl Clone for BuildInput
Source§fn clone(&self) -> BuildInput
fn clone(&self) -> BuildInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BuildInput
impl Debug for BuildInput
Source§impl<'de> Deserialize<'de> for BuildInput
impl<'de> Deserialize<'de> for BuildInput
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 BuildInput
impl PartialEq for BuildInput
Source§impl Serialize for BuildInput
impl Serialize for BuildInput
impl Eq for BuildInput
impl StructuralPartialEq for BuildInput
Auto Trait Implementations§
impl Freeze for BuildInput
impl RefUnwindSafe for BuildInput
impl Send for BuildInput
impl Sync for BuildInput
impl Unpin for BuildInput
impl UnwindSafe for BuildInput
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.