Skip to main content

Gates

Struct Gates 

Source
pub struct Gates {
    pub global: Gate,
    /* private fields */
}
Expand description

The gate for every series, as tak.toml declares it.

Looked up by benchmark and tool, never by runner. A gate is a statement about a benchmark — how much of its count is the program’s own work — and that does not change with the machine it is measured on.

Fields§

§global: Gate

The [gate] settings: what a series without its own gate is held to.

Implementations§

Source§

impl Gates

Source

pub fn uniform(global: Gate) -> Self

The same gate for everything, as when there is no tak.toml.

Source

pub fn set_bench(&mut self, bench: &str, gate: Gate)

Source

pub fn set_series(&mut self, bench: &str, tool: &str, gate: Gate)

Source

pub fn get(&self, bench: &str, tool: &str) -> Gate

The gate for one series: its own, else its benchmark’s, else the global one.

A benchmark in the notes but no longer in tak.toml gets the global gate rather than none. It is usually on the base side only, where nothing gates it anyway; when it is on both, the project has not said it is special, and the gate everything else gets is the honest default.

Source

pub fn changes_from( &self, base: &Gates, measured: &BTreeSet<(String, String)>, ) -> Vec<String>

What these gates hold differently from base, by effective value: the global gate as [gate], then each series either side declares or measured names whose resolved gate differs.

Effective rather than structural. Declaring a benchmark with no gate adds it to the maps at the global gate, which is what an undeclared series gets anyway; reporting that as a change would tell a pull request that only added a benchmark its gate takes effect later. A series that merely follows [gate] on both sides is covered by [gate] and not named again.

Each entry is a code span, escaped by [code] like every other name in the report: a benchmark name comes from the change under review, and one holding a newline must not start a line of its own.

Trait Implementations§

Source§

impl Clone for Gates

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

impl Debug for Gates

Source§

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

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

impl PartialEq for Gates

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Gates

Auto Trait Implementations§

§

impl Forget for Gates

§

impl Freeze for Gates

§

impl Move for Gates

§

impl RefUnwindSafe for Gates

§

impl Send for Gates

§

impl Sync for Gates

§

impl Unpin for Gates

§

impl UnsafeUnpin for Gates

§

impl UnwindSafe for Gates

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.