pub struct ObjectWalker { /* private fields */ }Expand description
Iterative BFS walker for the PDF object graph.
Traverses objects starting from a root, tracking visited objects to
detect cycles. Enforces a safety limit of MAX_OBJECT_NUMBER visited
objects to prevent denial of service.
Implementations§
Source§impl ObjectWalker
impl ObjectWalker
Sourcepub fn with_max_objects(max_objects: usize) -> Self
pub fn with_max_objects(max_objects: usize) -> Self
Create a new walker with a custom maximum objects limit.
Sourcepub fn walk<S: PdfSource>(
&mut self,
store: &ObjectStore<S>,
root_id: ObjectId,
visitor: &mut dyn ObjectVisitor,
)
pub fn walk<S: PdfSource>( &mut self, store: &ObjectStore<S>, root_id: ObjectId, visitor: &mut dyn ObjectVisitor, )
Walk the object graph starting from root_id, calling visitor methods
for each object encountered.
Uses iterative BFS with cycle detection. Silently skips objects that cannot be resolved from the store.
Sourcepub fn visited_count(&self) -> usize
pub fn visited_count(&self) -> usize
Returns the number of unique objects visited so far.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObjectWalker
impl RefUnwindSafe for ObjectWalker
impl Send for ObjectWalker
impl Sync for ObjectWalker
impl Unpin for ObjectWalker
impl UnsafeUnpin for ObjectWalker
impl UnwindSafe for ObjectWalker
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