pub struct BoundReader { /* private fields */ }Expand description
What one run may read by a name its model wrote: the city it reads in, the read bound, and the store blocks are kept in. Cloned to every tool that reads bytes, so all of them ask one bound.
Implementations§
Source§impl BoundReader
impl BoundReader
Sourcepub fn new(
city_root: &Path,
bound: ReadBound,
block_store: &Path,
) -> BoundReader
pub fn new( city_root: &Path, bound: ReadBound, block_store: &Path, ) -> BoundReader
city_root is the tree the run reads in, its own worktree under
review; block_store is the city’s, which a worktree does not
hold.
Sourcepub fn open(&self, asked: &str, action: &'static str) -> Result<Opened, AxError>
pub fn open(&self, asked: &str, action: &'static str) -> Result<Opened, AxError>
The bytes asked names, once the judgement read gives it has
let them through: a cas: or file: Locator is opened where its
bytes belong, and anything else is a path, judged as written,
judged again where its links lead, and checked once more after it
is opened. action names the tool in every refusal.
§Errors
The codes read answers the same argument with: E_INVALID_ARGS
for a name that does not parse, a file that is not there and a
directory; E_GATE_DENIED for a reserved subtree, a building the
read bound closes, a place outside the city, a block stored for
no building, and a file that changed after it was judged;
E_STORAGE_FATAL for a file that is there and will not open.