Skip to main content

Reader

Struct Reader 

Source
pub struct Reader<'k> {
    pub k: &'k mut Kernel,
    pub refs: FxHashMap<String, ExprId>,
    pub parse_only: bool,
    pub stats: Stats,
    pub meter: Option<Box<dyn DeclMeter>>,
    pub trust_before: u64,
    pub fast_paths: bool,
    /* private fields */
}

Fields§

§k: &'k mut Kernel§refs: FxHashMap<String, ExprId>

Named reference terms ({"ref":{"key":…,"value":…}}), for files of kernel-internal terms.

§parse_only: bool

Read and intern every record but check no declaration: a measurement of the reader alone.

§stats: Stats§meter: Option<Box<dyn DeclMeter>>§trust_before: u64§fast_paths: bool

Read the common record layouts byte for byte (the default). Off, every record goes through the general parser — which must build exactly the same store.

Implementations§

Source§

impl<'k> Reader<'k>

Source

pub fn new(k: &'k mut Kernel) -> Reader<'k>

Source

pub fn size_hint(&mut self, bytes: u64)

Prepares the stores for an export of bytes bytes (about one expression per 45 bytes).

Source

pub fn run(&mut self, input: impl BufRead) -> KResult<()>

Reads and checks a whole export. Ok means every declaration was admitted.

Auto Trait Implementations§

§

impl<'k> Freeze for Reader<'k>

§

impl<'k> !RefUnwindSafe for Reader<'k>

§

impl<'k> !Send for Reader<'k>

§

impl<'k> !Sync for Reader<'k>

§

impl<'k> Unpin for Reader<'k>

§

impl<'k> UnsafeUnpin for Reader<'k>

§

impl<'k> !UnwindSafe for Reader<'k>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.