From 81a127bd5c432b36804af0d306980d283825e21d Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 4 Aug 2023 10:09:49 +0800 Subject: chain/item: Make some function public * chain/src/item/mod.rs: Some function and enum are needed across crates. --- chain/src/item/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'chain/src') 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 ForestLabel { - 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 } } -- cgit v1.2.3-18-g5258