nominal_api/conjure/objects/scout/versioning/api/
branch_and_commit.rs1#[derive(
2 Debug,
3 Clone,
4 conjure_object::serde::Serialize,
5 conjure_object::serde::Deserialize,
6 PartialEq,
7 Eq,
8 PartialOrd,
9 Ord,
10 Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct BranchAndCommit {
16 #[builder(custom(type = super::Branch, convert = Box::new))]
17 #[serde(rename = "branch")]
18 branch: Box<super::Branch>,
19 #[builder(custom(type = super::Commit, convert = Box::new))]
20 #[serde(rename = "commit")]
21 commit: Box<super::Commit>,
22}
23impl BranchAndCommit {
24 #[inline]
26 pub fn new(branch: super::Branch, commit: super::Commit) -> Self {
27 Self::builder().branch(branch).commit(commit).build()
28 }
29 #[inline]
30 pub fn branch(&self) -> &super::Branch {
31 &*self.branch
32 }
33 #[inline]
34 pub fn commit(&self) -> &super::Commit {
35 &*self.commit
36 }
37}