diff options
author | JSDurand <mmemmew@gmail.com> | 2023-08-04 10:09:49 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2023-08-04 10:09:49 +0800 |
commit | 81a127bd5c432b36804af0d306980d283825e21d (patch) | |
tree | 138cf8989228abf0dc8700b456e07977ac9dd8da /chain/src | |
parent | 57134c44207f7129035bbdbca0e4deff398defe3 (diff) |
chain/item: Make some function public
* chain/src/item/mod.rs: Some function and enum are needed across
crates.
Diffstat (limited to 'chain/src')
-rw-r--r-- | chain/src/item/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chain/src/item/mod.rs b/chain/src/item/mod.rs index d2c3127..ed41c61 100644 --- a/chain/src/item/mod.rs +++ b/chain/src/item/mod.rs @@ -89,10 +89,13 @@ impl PaVi { /// An internal type that indicates the status of a node as either a /// packed, cloned, or plain node. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default)] -enum ForestLabelType { +pub enum ForestLabelType { + /// A packed node Packed, + /// A plain node #[default] Plain, + /// A cloned node Cloned(usize), } @@ -144,7 +147,8 @@ impl std::fmt::Display for ForestLabelError { impl std::error::Error for ForestLabelError {} impl<T: GraphLabel> ForestLabel<T> { - fn new(label: T, status: ForestLabelType) -> Self { + /// Construct a new label with the inner `label` and `status`. + pub fn new(label: T, status: ForestLabelType) -> Self { Self { label, status } } |