pub struct DocumentNode {
pub id: Uuid,
pub node_type: String,
pub location: NodeLocation,
pub text_order: Option<u32>,
pub content: NodeContent,
pub style_info: Option<StyleMetadata>,
pub token_count: usize,
pub parent: Option<Uuid>,
pub children: Vec<Uuid>,
}Fields§
§id: Uuid§node_type: String§location: NodeLocation§text_order: Option<u32>§content: NodeContent§style_info: Option<StyleMetadata>§token_count: usize§parent: Option<Uuid>§children: Vec<Uuid>Implementations§
Source§impl DocumentNode
impl DocumentNode
Sourcepub fn new(node_type: &str, text: String) -> DocumentNode
pub fn new(node_type: &str, text: String) -> DocumentNode
Create a node with a random UUIDv4 ID (legacy, non-deterministic).
Sourcepub fn new_with_id(id: Uuid, node_type: &str, text: String) -> DocumentNode
pub fn new_with_id(id: Uuid, node_type: &str, text: String) -> DocumentNode
Create a node with a specific ID (for deterministic UUIDv5 generation).
pub fn new_with_physical( node_type: &str, text: String, page: Option<u32>, bounding_box: Option<BoundingBox>, ) -> DocumentNode
Trait Implementations§
Source§impl Clone for DocumentNode
impl Clone for DocumentNode
Source§fn clone(&self) -> DocumentNode
fn clone(&self) -> DocumentNode
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 DocumentNode
impl Debug for DocumentNode
Source§impl<'de> Deserialize<'de> for DocumentNode
impl<'de> Deserialize<'de> for DocumentNode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DocumentNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DocumentNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DocumentNode
impl Serialize for DocumentNode
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 DocumentNode
impl RefUnwindSafe for DocumentNode
impl Send for DocumentNode
impl Sync for DocumentNode
impl Unpin for DocumentNode
impl UnsafeUnpin for DocumentNode
impl UnwindSafe for DocumentNode
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