Skip to main content

Metrics

Struct Metrics 

Source
pub struct Metrics<E>
where E: Evaluator,
{ pub modules: HashSet<E::Id>, /* private fields */ }
Available on crate feature std only.
Expand description

An Evaluator adapter that collects metrics during evaluation.

Fields§

§modules: HashSet<E::Id>

Set of all evaluated modules.

Implementations§

Source§

impl<E> Metrics<E>
where E: Evaluator,

Source

pub fn new(evaluator: E) -> Self

Create a new Metrics adapter.

Source§

impl<E> Metrics<E>
where E: Evaluator + Default,

Source

pub fn get(&self) -> &E

Get a reference to the inner evaluator.

Source

pub fn get_mut(&mut self) -> &mut E

Get a mutable reference to the inner evaluator.

Trait Implementations§

Source§

impl<E> Clone for Metrics<E>
where E: Evaluator + Clone, E::Id: Clone,

Source§

fn clone(&self) -> Metrics<E>

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
Source§

impl<E> Debug for Metrics<E>
where E: Evaluator + Debug, E::Id: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> Default for Metrics<E>
where E: Evaluator + Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<E> Evaluator for Metrics<E>
where E: Evaluator, E::Id: Clone + Eq + Hash,

Source§

type Id = <E as Evaluator>::Id

Id of a module. Read more
Source§

type Module = <E as Evaluator>::Module

The type of the module.
Source§

type Error = <E as Evaluator>::Error

Evaluation error.
Source§

fn is_empty(&self) -> bool

Check whether the evaluator has evaluated any modules.
Source§

fn next(&mut self) -> Option<Self::Id>

Get the next module in evaluation order. Read more
Source§

fn eval( &mut self, id: Self::Id, imports: Imports<Self::Id>, module: Self::Module, ) -> Result<(), Self::Error>

Evaluate module identified by id that imports the modules specified by imports.
Source§

fn finish(self) -> Option<Self::Module>

Destruct the evaluator and get the final value. Read more

Auto Trait Implementations§

§

impl<E> Freeze for Metrics<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for Metrics<E>

§

impl<E> Send for Metrics<E>
where E: Send, <E as Evaluator>::Id: Send,

§

impl<E> Sync for Metrics<E>
where E: Sync, <E as Evaluator>::Id: Sync,

§

impl<E> Unpin for Metrics<E>
where E: Unpin, <E as Evaluator>::Id: Unpin,

§

impl<E> UnsafeUnpin for Metrics<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for Metrics<E>
where E: UnwindSafe, <E as Evaluator>::Id: UnwindSafe,

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 = 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.