pub struct BranchSpec { /* private fields */ }
Expand description
Represents a branch: a list of (branchpoint, branch value) pairs.
If a branch has the NULL_IDENT
IdentId
, that means it is a
baseline branch.
Baseline can mean either that the branch was unspecified, or that it was
specifically intended to be baseline, depending on the use case.
This ambiguity is something we should clean up eventually.
Implementations§
Source§impl BranchSpec
impl BranchSpec
Sourcepub fn simple(k: BranchpointId, v: IdentId) -> Self
pub fn simple(k: BranchpointId, v: IdentId) -> Self
Create a new branch with the given branchpoint/branch pair.
Sourcepub fn insert(&mut self, k: BranchpointId, v: IdentId)
pub fn insert(&mut self, k: BranchpointId, v: IdentId)
Insert the given branchpoint/branch pair into this BranchSpec.
Sourcepub fn get_specified(&self, k: BranchpointId) -> Option<IdentId>
pub fn get_specified(&self, k: BranchpointId) -> Option<IdentId>
Get the branch id if it is specified/non-baseline, otherwise None.
Sourcepub fn is_unspecified(&self, k: BranchpointId) -> bool
pub fn is_unspecified(&self, k: BranchpointId) -> bool
true if branchpoint k is unspecified/baseline.
Sourcepub fn is_specified(&self, k: BranchpointId) -> bool
pub fn is_specified(&self, k: BranchpointId) -> bool
true if branchpoint k is specified/non-baseline.
Sourcepub fn unset(&mut self, k: BranchpointId)
pub fn unset(&mut self, k: BranchpointId)
remove branch info for branchpoint k, leaving it unspecified/baseline.
Sourcepub fn is_compatible(&self, other: &Self) -> bool
pub fn is_compatible(&self, other: &Self) -> bool
true if all specified branches in this branch match with other branch; allowing any unspecified branches here to still count as a match.
Sourcepub fn is_exact_match(&self, other: &Self) -> bool
pub fn is_exact_match(&self, other: &Self) -> bool
true if all specified branches in this branch exactly match other branch.
Sourcepub fn insert_all(&mut self, other: &Self)
pub fn insert_all(&mut self, other: &Self)
Insert all defined branches from other
into self
.
Trait Implementations§
Source§impl Clone for BranchSpec
impl Clone for BranchSpec
Source§fn clone(&self) -> BranchSpec
fn clone(&self) -> BranchSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more