Skip to main content

BoundReader

Struct BoundReader 

Source
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

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for BoundReader

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.