You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to pass state from one ReadDir to the next.
I don't mind if it's ReadDirState or DirEntryState.
At the moment, I'm limited between passing the same state to all child directories (via ReadDirState), or I can pass state to all children (via DirEntry::client_state), but the entry or its state won't be accessible in the next process_read_dir call.
When using process_read_dir, I have access to the previous DirEntryState (cloned from the parent), and I can update it, but all ReadDir calls built from children will share the same ReadDirState, and I need to make them distinct.
I see two ways to fix this:
add an entry argument to the process_read_dir closure, replacing the current depth and path arguments with a DirEntry. Depth, path, client_state, file_type… can all be accessed on the entry.
split the children argument to the closure into yield_children and recurse_children (elements can appear on either or both). recurse_children should be a Vec<RecEntry> with RecEntry containing at least a path and a ReadDirState.
The text was updated successfully, but these errors were encountered:
g2p
added a commit
to g2p/jwalk
that referenced
this issue
Mar 10, 2023
I would like to pass state from one
ReadDir
to the next.I don't mind if it's
ReadDirState
orDirEntryState
.At the moment, I'm limited between passing the same state to all child directories (via
ReadDirState
), or I can pass state to all children (viaDirEntry::client_state
), but the entry or its state won't be accessible in the nextprocess_read_dir
call.When using
process_read_dir
, I have access to the previousDirEntryState
(cloned from the parent), and I can update it, but allReadDir
calls built from children will share the sameReadDirState
, and I need to make them distinct.I see two ways to fix this:
entry
argument to theprocess_read_dir
closure, replacing the current depth and path arguments with aDirEntry
. Depth, path, client_state, file_type… can all be accessed on the entry.children
argument to the closure intoyield_children
andrecurse_children
(elements can appear on either or both).recurse_children
should be aVec<RecEntry>
withRecEntry
containing at least a path and aReadDirState
.The text was updated successfully, but these errors were encountered: