#[non_exhaustive]pub enum RcfError {
DimensionMismatch {
expected: usize,
got: usize,
},
InvalidConfig(Box<str>),
EmptyForest,
EmptyBoundingBox,
NaNValue,
OutOfBounds {
index: usize,
len: usize,
},
SerializationFailed(String),
DeserializationFailed(String),
IncompatibleVersion {
found: u32,
expected: u32,
},
}Expand description
Errors produced by anomstream-core.
Variants are stable across 0.x patch releases — adding a new
variant is a minor-version change.
§Examples
use anomstream_core::{ForestBuilder, RcfError};
let err = ForestBuilder::<4>::new().num_trees(10).build().unwrap_err();
assert!(matches!(err, RcfError::InvalidConfig(_)));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DimensionMismatch
A point with the wrong dimensionality was supplied.
Fields
InvalidConfig(Box<str>)
A configuration value falls outside the AWS SageMaker spec
bounds enforced by ForestBuilder. The message payload is
Box<str> rather than String so the variant fits in
16 bytes on 64-bit targets (vs 24 for String) — matters
when RcfError propagates through hot-path return values.
EmptyForest
An operation that requires a non-empty forest was attempted on
an empty one (e.g. scoring before any update call).
EmptyBoundingBox
A bounding box operation was requested on an empty box.
NaNValue
A floating-point input contained NaN, which would break the
total ordering required by every algorithm in the crate.
OutOfBounds
An indexed access fell outside the live range.
Fields
SerializationFailed(String)
Persistence: serialising the forest failed.
Left as String (not Box<str>) because every emission
site formats a fresh heap-allocated message from an
upstream serde / postcard error — the extra 8 bytes
per variant vs Box<str> would cost a round-trip through
Box::from(String) on an already-cold path.
DeserializationFailed(String)
Persistence: deserialising the forest failed (truncated bytes,
malformed JSON, version-skew payload, etc). See
Self::SerializationFailed for the String-vs-Box<str>
rationale.
IncompatibleVersion
Persistence: the encoded version prefix does not match the running library’s expected version.
Trait Implementations§
Source§impl Error for RcfError
impl Error for RcfError
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()
Auto Trait Implementations§
impl Freeze for RcfError
impl RefUnwindSafe for RcfError
impl Send for RcfError
impl Sync for RcfError
impl Unpin for RcfError
impl UnsafeUnpin for RcfError
impl UnwindSafe for RcfError
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> 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