#[non_exhaustive]pub struct PlanLimits {
pub max_acts: Option<usize>,
pub max_questions: Option<usize>,
pub max_constraints: Option<usize>,
}Expand description
Limits applied to an Understanding; None is unlimited.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_acts: Option<usize>Maximum number of acts.
max_questions: Option<usize>Maximum number of questions.
max_constraints: Option<usize>Maximum number of constraints.
Implementations§
Source§impl PlanLimits
impl PlanLimits
Sourcepub const fn conservative() -> Self
pub const fn conservative() -> Self
No limits at all, which is what ships.
Sourcepub const fn with_max_acts(self, max_acts: Option<usize>) -> Self
pub const fn with_max_acts(self, max_acts: Option<usize>) -> Self
Returns a copy with another act limit.
Sourcepub const fn with_max_questions(self, max_questions: Option<usize>) -> Self
pub const fn with_max_questions(self, max_questions: Option<usize>) -> Self
Returns a copy with another question limit.
Sourcepub const fn with_max_constraints(self, max_constraints: Option<usize>) -> Self
pub const fn with_max_constraints(self, max_constraints: Option<usize>) -> Self
Returns a copy with another constraint limit.
Sourcepub fn enforce(
&self,
understanding: &Understanding,
) -> Result<(), PlanLimitError>
pub fn enforce( &self, understanding: &Understanding, ) -> Result<(), PlanLimitError>
Trait Implementations§
Source§impl Clone for PlanLimits
impl Clone for PlanLimits
impl Copy for PlanLimits
Source§impl Debug for PlanLimits
impl Debug for PlanLimits
Source§impl Default for PlanLimits
impl Default for PlanLimits
Source§impl<'de> Deserialize<'de> for PlanLimits
impl<'de> Deserialize<'de> for PlanLimits
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PlanLimits
Source§impl PartialEq for PlanLimits
impl PartialEq for PlanLimits
Source§impl Serialize for PlanLimits
impl Serialize for PlanLimits
impl StructuralPartialEq for PlanLimits
Auto Trait Implementations§
impl Freeze for PlanLimits
impl RefUnwindSafe for PlanLimits
impl Send for PlanLimits
impl Sync for PlanLimits
impl Unpin for PlanLimits
impl UnsafeUnpin for PlanLimits
impl UnwindSafe for PlanLimits
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
Compare self to
key and return true if they are equal.