pub enum SurvivalConstructionError {
InvalidConfig {
reason: String,
},
MissingColumn {
reason: String,
},
IncompatibleDimensions {
reason: String,
},
DataValidationFailed {
reason: String,
},
BasisConstructionFailed {
reason: String,
},
UnsupportedDistribution {
reason: String,
},
}Expand description
Structured failure surface for survival-model construction helpers
(parse_*, baseline-config builders, time-basis construction). Every
variant carries a free-form reason: String payload; Display emits
that payload verbatim, so converting to String via the From impl
produces text byte-equivalent to the pre-refactor Err(format!(...))
call sites that were the only producers in this module.
The public CLI-input parsers (parse_survival_distribution,
parse_survival_likelihood_mode, parse_survival_baseline_config)
keep their Result<_, String> signatures — string is the natural
failure type for free-form user input — and route through this enum
internally via From<SurvivalConstructionError> for String.
Variants§
InvalidConfig
User-supplied configuration is malformed or out of range (knot counts, anchor offsets, derivative guards, ranks).
MissingColumn
A required column or block of metadata is absent (e.g. saved survival ispline keep_cols, baseline target on a saved fit).
IncompatibleDimensions
Per-row / per-column shape disagreement (entry/exit lengths, penalty rank vs basis width, basis vs coefficient counts).
DataValidationFailed
Numeric / domain rejection: non-finite ratios, non-positive survival times, monotonicity violations, ispline-derivative underflow.
BasisConstructionFailed
Underlying basis / penalty builder rejected the construction request (invalid spline order, ispline keep_cols out of range, internal empty ispline time basis).
UnsupportedDistribution
User-named distribution / likelihood-mode / baseline target / time-basis kind is not one we recognise.
Trait Implementations§
Source§impl Clone for SurvivalConstructionError
impl Clone for SurvivalConstructionError
Source§fn clone(&self) -> SurvivalConstructionError
fn clone(&self) -> SurvivalConstructionError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SurvivalConstructionError
impl Debug for SurvivalConstructionError
Source§impl Display for SurvivalConstructionError
impl Display for SurvivalConstructionError
Source§impl Error for SurvivalConstructionError
impl Error for SurvivalConstructionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<SurvivalConstructionError> for String
impl From<SurvivalConstructionError> for String
Source§fn from(err: SurvivalConstructionError) -> String
fn from(err: SurvivalConstructionError) -> String
Auto Trait Implementations§
impl Freeze for SurvivalConstructionError
impl RefUnwindSafe for SurvivalConstructionError
impl Send for SurvivalConstructionError
impl Sync for SurvivalConstructionError
impl Unpin for SurvivalConstructionError
impl UnsafeUnpin for SurvivalConstructionError
impl UnwindSafe for SurvivalConstructionError
Blanket Implementations§
impl<T> Allocation for T
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
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,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.