pub struct QuestionLimits {
pub max_choice_options: Option<usize>,
pub max_score_levels: Option<usize>,
}Expand description
The upper size limits a model accepts, per question type.
Unlike the minimums, which are omni-dev policy, these are API limits that
belong to a model version: a later model may raise them. None means
“not known, so not enforced”, which is what every model without an entry in
QuestionLimits::for_model gets, so a stale cap can never block a valid
request.
Fields§
§max_choice_options: Option<usize>Most options a choice may offer.
max_score_levels: Option<usize>Most levels a score scale may have.
Implementations§
Source§impl QuestionLimits
impl QuestionLimits
Sourcepub fn for_model(model: &str) -> Self
pub fn for_model(model: &str) -> Self
The limits for model: the single table to extend when a model
documents different caps.
jev-1.13 and jev-1.13.<digits> match, but jev-1.130 and
jev-1.13.x do not. jev-latest is enforced with the jev-1.13 caps
because that is what the alias resolves to today. That is a bet: if
TypeSafe repoints the alias at a model with higher caps, the check goes
stale for default users until this table is updated, and pinning
--jev-model to a version without an entry here is the way round it.
Any other model gets Self::UNLIMITED, so a cap that is not known is
never enforced.
Trait Implementations§
Source§impl Clone for QuestionLimits
impl Clone for QuestionLimits
impl Copy for QuestionLimits
Source§impl Debug for QuestionLimits
impl Debug for QuestionLimits
impl Eq for QuestionLimits
Source§impl PartialEq for QuestionLimits
impl PartialEq for QuestionLimits
impl StructuralPartialEq for QuestionLimits
Auto Trait Implementations§
impl Freeze for QuestionLimits
impl RefUnwindSafe for QuestionLimits
impl Send for QuestionLimits
impl Sync for QuestionLimits
impl Unpin for QuestionLimits
impl UnsafeUnpin for QuestionLimits
impl UnwindSafe for QuestionLimits
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,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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