Skip to content

Commit 00c72bc

Browse files
authored
making graph structs public for external consumption (#152)
1 parent 58f5a74 commit 00c72bc

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/conflict.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl Conflict {
213213

214214
/// A node in the graph representation of a [`Conflict`]
215215
#[derive(Copy, Clone, Eq, PartialEq)]
216-
pub(crate) enum ConflictNode {
216+
pub enum ConflictNode {
217217
/// Node corresponding to a solvable
218218
Solvable(SolvableOrRootId),
219219
/// Node representing a dependency without candidates
@@ -242,7 +242,7 @@ impl ConflictNode {
242242

243243
/// An edge in the graph representation of a [`Conflict`]
244244
#[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
245-
pub(crate) enum ConflictEdge {
245+
pub enum ConflictEdge {
246246
/// The target node is a candidate for the dependency specified by the
247247
/// [`Requirement`]
248248
Requires(Requirement),
@@ -268,7 +268,7 @@ impl ConflictEdge {
268268

269269
/// Conflict causes
270270
#[derive(Copy, Clone, Hash, Eq, PartialEq, Ord, PartialOrd)]
271-
pub(crate) enum ConflictCause {
271+
pub enum ConflictCause {
272272
/// The solvable is locked
273273
Locked(SolvableId),
274274
/// The target node is constrained by the specified version set
@@ -299,9 +299,12 @@ pub struct MergedConflictNode {
299299
/// directly or indirectly involved in the conflict.
300300
#[derive(Clone)]
301301
pub struct ConflictGraph {
302-
graph: DiGraph<ConflictNode, ConflictEdge>,
303-
root_node: NodeIndex,
304-
unresolved_node: Option<NodeIndex>,
302+
/// The conflict graph as a directed petgraph.
303+
pub graph: DiGraph<ConflictNode, ConflictEdge>,
304+
/// The single source node for root constraints introduced to the solver.
305+
pub root_node: NodeIndex,
306+
/// A single sink node that consumes all unresolvable constraints.
307+
pub unresolved_node: Option<NodeIndex>,
305308
}
306309

307310
impl ConflictGraph {

src/internal/id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<I: Interner> Display for DisplaySolvableId<'_, I> {
211211

212212
#[repr(transparent)]
213213
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
214-
pub(crate) struct SolvableOrRootId(u32);
214+
pub struct SolvableOrRootId(u32);
215215

216216
impl SolvableOrRootId {
217217
pub fn root() -> Self {

0 commit comments

Comments
 (0)