Skip to main content

Acceptances

Struct Acceptances 

Source
pub struct Acceptances(/* private fields */);
Expand description

Accepted benchmark names, each with every source that accepted it.

Keyed on the benchmark name alone, so an acceptance covers every tool and runner that benchmark was measured with. The name is what a user declares in tak.toml and sees in the report; the runner in particular is something a commit author cannot know ahead of time.

Implementations§

Source§

impl Acceptances

Source

pub fn add_name(&mut self, name: &str, source: Source) -> Result<()>

Add one exact name, as --accept gives it.

Not split on commas and not trimmed. Benchmark names are unrestricted, so " startup " is a different benchmark from startup, and trimming would accept the wrong one’s regression — waiving a gate nobody asked to waive. The flag is repeatable, which covers every list without a separator. An empty value is an error rather than skipped: it is almost always an unset variable in a CI script, and silently accepting nothing hides that.

Source

pub fn add_trailer_log(&mut self, log: &str)

Parse the output of crate::notes::trailers: one line per commit, the SHA and then each trailer value, NUL-separated.

One trailer names one benchmark, the whole value, exactly as --accept takes one name per flag. It used to be split on commas, which made a benchmark named a,b impossible to accept and Tak-Accept: a,b accept two unrelated ones instead — waiving gates nobody named. Benchmark names are unrestricted, so no separator inside a value is safe; several benchmarks take several trailers.

Nothing else is stripped: Tak-Accept: startup (new plugin loader) names a benchmark that does not exist and is reported as such, which fails closed — the real startup regression still gates — rather than guessing which word was meant. git has already trimmed the value, so a trailer cannot name a benchmark with leading or trailing spaces; that takes --accept.

Source

pub fn is_empty(&self) -> bool

Source

pub fn covers(&self, bench: &str) -> bool

Source

pub fn iter(&self) -> impl Iterator<Item = (&str, &BTreeSet<Source>)>

Every accepted name with its sources, in a stable order.

Source

pub fn describe(&self, bench: &str) -> String

Where bench was accepted from, for the report.

Trait Implementations§

Source§

impl Clone for Acceptances

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 Acceptances

Source§

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

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

impl Default for Acceptances

Source§

fn default() -> Self

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

impl PartialEq for Acceptances

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 Acceptances

Auto Trait Implementations§

§

impl Forget for Acceptances

§

impl Freeze for Acceptances
where *const LeafNode<String, BTreeSet<Source>> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, BTreeSet<Source>)>>: Freeze,

§

impl Move for Acceptances

§

impl RefUnwindSafe for Acceptances

§

impl Send for Acceptances
where NodeRef<Owned, String, BTreeSet<Source>, LeafOrInternal>: Send, BoxRaw<(String, BTreeSet<Source>)>: Send,

§

impl Sync for Acceptances
where NodeRef<Owned, String, BTreeSet<Source>, LeafOrInternal>: Sync, BoxRaw<(String, BTreeSet<Source>)>: Sync,

§

impl Unpin for Acceptances
where *const LeafNode<String, BTreeSet<Source>> is !null: Unpin, Box<(String, BTreeSet<Source>)>: Unpin,

§

impl UnsafeUnpin for Acceptances
where *const LeafNode<String, BTreeSet<Source>> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, BTreeSet<Source>)>>: UnsafeUnpin,

§

impl UnwindSafe for Acceptances

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.