Search
The registry can filter states by pattern and look up state file paths
Searching by Pattern
search returns a StateIterator that yields only the names of states that match a regular expression
Rust
// Find all states starting with "batch-"
for name in reader.states().search("^batch-")? {
println!("{}", name?);
}
Python
for name in reader.states.search("^batch-"):
print(name)
The
searchpattern is a regular expression, not a glob. Use"^batch-"to match names starting with “batch-”, not"batch-*"
Auto-Generated Names
When you create an iterator without specifying a state name (or with state=None in Python), preader auto-generates a name from the SHA-256 hash of the file’s canonical path. You can look up what that name would be with autoname
Rust
let name = reader.states().autoname(&file);
println!("auto-name for data.txt: {name}");
autonameis available in Rust only. In Python, the auto-name is computed internally whenstateisNone
State File Path
path returns the filesystem path where a state file would be stored. It does not check whether the file actually exists
Rust
let path = reader.states().path("job-1")?;
println!("state file: {}", path.display());
Python
path = reader.states.path("job-1")
print(f"state file: {path}")
You can use this for debugging or to inspect the raw state JSON on disk