|
1 | 1 | // SPDX-License-Identifier: Apache-2.0 |
2 | 2 | // SPDX-FileCopyrightText: Copyright the Vortex contributors |
3 | 3 |
|
4 | | -use std::fmt; |
5 | | - |
6 | 4 | pub use vortex_utils::tree::IndentedFormatter; |
7 | 5 | use vortex_utils::tree::TreeDisplayContext; |
| 6 | +pub use vortex_utils::tree::TreeDisplayExtractor as TreeExtractor; |
8 | 7 |
|
9 | 8 | use crate::ArrayRef; |
10 | 9 | use crate::arrays::Chunked; |
@@ -44,37 +43,3 @@ impl TreeDisplayContext<ArrayRef> for TreeContext { |
44 | 43 | self.ancestor_sizes.pop(); |
45 | 44 | } |
46 | 45 | } |
47 | | - |
48 | | -/// Trait for contributing display information to tree nodes. |
49 | | -/// |
50 | | -/// Each extractor represents one "dimension" of display (e.g., nbytes, stats, metadata, buffers). |
51 | | -/// Extractors are composable: you can combine any number of them via [`TreeDisplay::with`]. |
52 | | -/// |
53 | | -/// [`TreeDisplay::with`]: super::TreeDisplay::with |
54 | | -pub trait TreeExtractor: Send + Sync { |
55 | | - /// Write header annotations (space-prefixed) to the formatter. |
56 | | - fn write_header( |
57 | | - &self, |
58 | | - array: &ArrayRef, |
59 | | - ctx: &TreeContext, |
60 | | - f: &mut fmt::Formatter<'_>, |
61 | | - ) -> fmt::Result { |
62 | | - let _ = (array, ctx, f); |
63 | | - Ok(()) |
64 | | - } |
65 | | - |
66 | | - /// Write detail lines below the header. |
67 | | - /// |
68 | | - /// Content written through `f` is automatically indented. Use |
69 | | - /// [`f.formatter()`](IndentedFormatter::formatter) to access the underlying |
70 | | - /// [`fmt::Formatter`] for formatting flags. |
71 | | - fn write_details( |
72 | | - &self, |
73 | | - array: &ArrayRef, |
74 | | - ctx: &TreeContext, |
75 | | - f: &mut IndentedFormatter<'_, '_>, |
76 | | - ) -> fmt::Result { |
77 | | - let _ = (array, ctx, f); |
78 | | - Ok(()) |
79 | | - } |
80 | | -} |
0 commit comments