#[non_exhaustive]pub struct SourceContext {
pub labels: HashMap<String, String>,
pub context: Option<Context>,
/* private fields */
}Expand description
A SourceContext is a reference to a tree of files. A SourceContext together with a path point to a unique revision of a single file or directory.
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.labels: HashMap<String, String>Labels with user defined metadata.
context: Option<Context>A SourceContext can refer any one of the following types of repositories.
Implementations§
Source§impl SourceContext
impl SourceContext
pub fn new() -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_context<T: Into<Option<Context>>>(self, v: T) -> Self
pub fn set_context<T: Into<Option<Context>>>(self, v: T) -> Self
Sets the value of context.
Note that all the setters affecting context are mutually
exclusive.
§Example
use google_cloud_grafeas_v1::model::CloudRepoSourceContext;
let x = SourceContext::new().set_context(Some(
google_cloud_grafeas_v1::model::source_context::Context::CloudRepo(CloudRepoSourceContext::default().into())));Sourcepub fn cloud_repo(&self) -> Option<&Box<CloudRepoSourceContext>>
pub fn cloud_repo(&self) -> Option<&Box<CloudRepoSourceContext>>
The value of context
if it holds a CloudRepo, None if the field is not set or
holds a different branch.
Sourcepub fn set_cloud_repo<T: Into<Box<CloudRepoSourceContext>>>(self, v: T) -> Self
pub fn set_cloud_repo<T: Into<Box<CloudRepoSourceContext>>>(self, v: T) -> Self
Sets the value of context
to hold a CloudRepo.
Note that all the setters affecting context are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::CloudRepoSourceContext;
let x = SourceContext::new().set_cloud_repo(CloudRepoSourceContext::default()/* use setters */);
assert!(x.cloud_repo().is_some());
assert!(x.gerrit().is_none());
assert!(x.git().is_none());Sourcepub fn gerrit(&self) -> Option<&Box<GerritSourceContext>>
pub fn gerrit(&self) -> Option<&Box<GerritSourceContext>>
The value of context
if it holds a Gerrit, None if the field is not set or
holds a different branch.
Sourcepub fn set_gerrit<T: Into<Box<GerritSourceContext>>>(self, v: T) -> Self
pub fn set_gerrit<T: Into<Box<GerritSourceContext>>>(self, v: T) -> Self
Sets the value of context
to hold a Gerrit.
Note that all the setters affecting context are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::GerritSourceContext;
let x = SourceContext::new().set_gerrit(GerritSourceContext::default()/* use setters */);
assert!(x.gerrit().is_some());
assert!(x.cloud_repo().is_none());
assert!(x.git().is_none());Sourcepub fn git(&self) -> Option<&Box<GitSourceContext>>
pub fn git(&self) -> Option<&Box<GitSourceContext>>
The value of context
if it holds a Git, None if the field is not set or
holds a different branch.
Sourcepub fn set_git<T: Into<Box<GitSourceContext>>>(self, v: T) -> Self
pub fn set_git<T: Into<Box<GitSourceContext>>>(self, v: T) -> Self
Sets the value of context
to hold a Git.
Note that all the setters affecting context are
mutually exclusive.
§Example
use google_cloud_grafeas_v1::model::GitSourceContext;
let x = SourceContext::new().set_git(GitSourceContext::default()/* use setters */);
assert!(x.git().is_some());
assert!(x.cloud_repo().is_none());
assert!(x.gerrit().is_none());Trait Implementations§
Source§impl Clone for SourceContext
impl Clone for SourceContext
Source§fn clone(&self) -> SourceContext
fn clone(&self) -> SourceContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more