pub struct ColumnLimit {
pub max_items: Option<u32>,
pub max_estimate: Option<u32>,
pub unit: Option<String>,
pub policy: Option<LimitPolicy>,
pub enabled: bool,
}Expand description
One column’s limit.
Both ceilings are optional and independent: a column may cap the number of cards, the estimate they add up to, or both. An enabled limit with neither is refused, because a limit that limits nothing is a configuration mistake that would otherwise read as an enforced rule.
Fields§
§max_items: Option<u32>The most cards the column may hold.
max_estimate: Option<u32>The most estimate the column’s cards may add up to, counted in unit.
unit: Option<String>The unit max_estimate counts in. Required with max_estimate, refused
without it: a unit on an item-count limit would describe nothing.
policy: Option<LimitPolicy>warn or block. Required for an enabled limit (see the module docs).
enabled: boolWhether the limit is enforced. false keeps the numbers for later without
changing any behaviour today.
Implementations§
Source§impl ColumnLimit
impl ColumnLimit
Sourcepub fn items(max_items: u32, policy: LimitPolicy) -> Self
pub fn items(max_items: u32, policy: LimitPolicy) -> Self
A limit capping the column at max_items cards, with policy.
Sourcepub fn estimate(
max_estimate: u32,
unit: impl Into<String>,
policy: LimitPolicy,
) -> Self
pub fn estimate( max_estimate: u32, unit: impl Into<String>, policy: LimitPolicy, ) -> Self
A limit capping the column at max_estimate units, with policy.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether nothing at all is declared: the state the schema omits on save.
Sourcepub fn resolved_policy(&self) -> Option<LimitPolicy>
pub fn resolved_policy(&self) -> Option<LimitPolicy>
The policy this limit enforces, when it is enforced at all.
None for a disabled limit and for an enabled one that forgot to state a
policy — validation refuses the latter, so a caller that has validated a
config and asked an enabled limit for its policy always gets one.
Trait Implementations§
Source§impl Clone for ColumnLimit
impl Clone for ColumnLimit
Source§impl Debug for ColumnLimit
impl Debug for ColumnLimit
Source§impl Default for ColumnLimit
impl Default for ColumnLimit
Source§impl<'de> Deserialize<'de> for ColumnLimitwhere
ColumnLimit: Default,
impl<'de> Deserialize<'de> for ColumnLimitwhere
ColumnLimit: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ColumnLimit
Source§impl PartialEq for ColumnLimit
impl PartialEq for ColumnLimit
Source§impl Serialize for ColumnLimit
impl Serialize for ColumnLimit
impl StructuralPartialEq for ColumnLimit
Auto Trait Implementations§
impl Freeze for ColumnLimit
impl RefUnwindSafe for ColumnLimit
impl Send for ColumnLimit
impl Sync for ColumnLimit
impl Unpin for ColumnLimit
impl UnsafeUnpin for ColumnLimit
impl UnwindSafe for ColumnLimit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more