pub struct DocumentGraph {
pub nodes: HashMap<Uuid, DocumentNode>,
pub document_info: DocumentInfo,
pub structural_profile: StructuralProfile,
}Fields§
§nodes: HashMap<Uuid, DocumentNode>§document_info: DocumentInfo§structural_profile: StructuralProfileImplementations§
Source§impl DocumentGraph
impl DocumentGraph
Sourcepub fn compute_structural_profile(&mut self)
pub fn compute_structural_profile(&mut self)
Compute structural profile analytics for the entire graph
Source§impl DocumentGraph
impl DocumentGraph
Sourcepub fn new_with_root(root_id: Uuid) -> DocumentGraph
pub fn new_with_root(root_id: Uuid) -> DocumentGraph
Create a new graph with a deterministic root ID.
Sourcepub fn new() -> DocumentGraph
pub fn new() -> DocumentGraph
Create a new graph with a random UUIDv4 root ID (legacy).
pub fn max_depth(&self) -> u32
pub fn save_to_json(&self, path: &str) -> Result<(), Error>
pub fn to_sorted_graph(&self) -> SortedDocumentGraph
Compute breadcrumbs for all nodes by walking the tree top-down. Sections contribute their text to the trail. Non-section nodes inherit their parent’s breadcrumbs without adding to them. If document metadata has a title, it becomes the first breadcrumb.
Sourcepub fn _analyze_subtree(
&self,
root_node_id: Uuid,
) -> Option<GraphAnalyticsResult>
pub fn _analyze_subtree( &self, root_node_id: Uuid, ) -> Option<GraphAnalyticsResult>
Analyze any subtree starting from given node
Source§impl DocumentGraph
impl DocumentGraph
pub fn to_sequential_format(&self) -> SequentialDocument
pub fn to_flat_format(&self) -> FlatDocument
pub fn save_with_format(&self, path: &str, format: &str) -> Result<(), Error>
Trait Implementations§
Source§impl Clone for DocumentGraph
impl Clone for DocumentGraph
Source§fn clone(&self) -> DocumentGraph
fn clone(&self) -> DocumentGraph
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentGraph
impl Debug for DocumentGraph
Source§impl Default for DocumentGraph
impl Default for DocumentGraph
Source§fn default() -> DocumentGraph
fn default() -> DocumentGraph
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DocumentGraph
impl<'de> Deserialize<'de> for DocumentGraph
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DocumentGraph, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DocumentGraph, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DocumentGraph
impl Serialize for DocumentGraph
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DocumentGraph
impl RefUnwindSafe for DocumentGraph
impl Send for DocumentGraph
impl Sync for DocumentGraph
impl Unpin for DocumentGraph
impl UnsafeUnpin for DocumentGraph
impl UnwindSafe for DocumentGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more