Skip to main content

Ceiling

Struct Ceiling 

Source
pub struct Ceiling { /* private fields */ }
Expand description

One limit check measures a result against, and the sentence it produces when the result exceeds it.

check had four of these written out in full, differing only in what they counted and how the number reads – a group count as an integer, a duplicated-line share to one decimal place. Four copies of one shape is how a function acquires branches it does not need.

Implementations§

Source§

impl Ceiling

Source

pub fn count(limit: Option<usize>, actual: usize, subject: &'static str) -> Self

A ceiling on a number of groups.

Source

pub fn percent( limit: Option<Threshold>, actual: f64, subject: &'static str, ) -> Self

A ceiling on a share of duplicated lines.

Source

pub fn breach(&self) -> Option<String>

What to say when the ceiling is exceeded, and None when it is not.

An unset limit is not a ceiling of zero. It means the caller did not ask, so nothing can breach it.

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