#[non_exhaustive]pub struct Source {
pub artifact_storage_source_uri: String,
pub file_hashes: HashMap<String, FileHashes>,
pub context: Option<SourceContext>,
pub additional_contexts: Vec<SourceContext>,
/* private fields */
}Expand description
Source describes the location of the source used for the build.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.artifact_storage_source_uri: StringIf provided, the input binary artifacts for the build came from this location.
file_hashes: HashMap<String, FileHashes>Hash(es) of the build source, which can be used to verify that the original source integrity was maintained in the build.
The keys to this map are file paths used as build source and the values contain the hash values for those files.
If the build source came in a single package such as a gzipped tarfile (.tar.gz), the FileHash will be for the single path to that file.
context: Option<SourceContext>If provided, the source code used for the build came from this location.
additional_contexts: Vec<SourceContext>If provided, some of the source code used for the build may be found in these locations, in the case where the source repository had multiple remotes or submodules. This list will not include the context specified in the context field.
Implementations§
Source§impl Source
impl Source
pub fn new() -> Self
Sourcepub fn set_artifact_storage_source_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_artifact_storage_source_uri<T: Into<String>>(self, v: T) -> Self
Sets the value of artifact_storage_source_uri.
§Example
let x = Source::new().set_artifact_storage_source_uri("example");Sourcepub fn set_file_hashes<T, K, V>(self, v: T) -> Self
pub fn set_file_hashes<T, K, V>(self, v: T) -> Self
Sets the value of file_hashes.
§Example
use google_cloud_grafeas_v1::model::FileHashes;
let x = Source::new().set_file_hashes([
("key0", FileHashes::default()/* use setters */),
("key1", FileHashes::default()/* use (different) setters */),
]);Sourcepub fn set_context<T>(self, v: T) -> Selfwhere
T: Into<SourceContext>,
pub fn set_context<T>(self, v: T) -> Selfwhere
T: Into<SourceContext>,
Sourcepub fn set_or_clear_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceContext>,
pub fn set_or_clear_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceContext>,
Sourcepub fn set_additional_contexts<T, V>(self, v: T) -> Self
pub fn set_additional_contexts<T, V>(self, v: T) -> Self
Sets the value of additional_contexts.
§Example
use google_cloud_grafeas_v1::model::SourceContext;
let x = Source::new()
.set_additional_contexts([
SourceContext::default()/* use setters */,
SourceContext::default()/* use (different) setters */,
]);