pub enum NamErrorCode {
Show 42 variants
FileNotFound,
FileReadError,
UnknownExtension,
NamJsonParseError,
NamJsonWeightsExceedLimit,
NamJsonTrainingTooLarge,
NamJsonTrainingTooDeep,
NamJsonSubmodelsExceedLimit,
NamJsonSubmodelsTooDeep,
NamJsonWeightNotFinite,
NamJsonInvalidSampleRate,
NamJsonUnsupportedTopology,
NamJsonInvalidVersionFormat,
NamJsonUnsupportedVersion,
NamJsonUnsupportedMultiChannel,
NambNonFiniteWeight,
NambInvalidHeaderField,
NambCrc32Mismatch,
NambCrc32Missing,
NambInvalidMagic,
NambUnsupportedVersion,
NambTruncated,
UnsupportedArchitecture,
TopologyDetectionFailed,
WeightCountMismatch,
ModelBuildFailed,
ModelTooLarge,
PipewireInitFailed,
StreamConnectFailed,
ResamplerBuildFailed,
ResamplerChannelFull,
SchedFifoDenied,
CpuAffinityFailed,
DeadlineExceeded,
ParamChannelFull,
InvalidGainValue,
UnknownCommand,
CtrlCHandlerFailed,
IrLoadFailed,
GcOverflow,
GcCorrupted,
OutOfMemory,
}Expand description
Structured error code for precise failure triage.
Each variant maps to exactly one failure scenario. The numeric code (used in the support block) follows the convention:
- E1xxx: Model loading (I/O, parse, build)
- E2xxx: PipeWire / audio (init, stream, resampler, RT)
- E3xxx: SPSC / inter-thread communication
- E4xxx: Runtime / CLI (parsing, commands)
- E5xxx: System / hardware (CPU features, memory)
Variants§
FileNotFound
Model file not found on the filesystem.
FileReadError
I/O read error while accessing the model file.
UnknownExtension
Unknown file extension (expected .nam or .namb).
NamJsonParseError
Failed to parse JSON in .nam format.
NamJsonWeightsExceedLimit
JSON weights array exceeds float limit (MAX_WEIGHTS).
NamJsonTrainingTooLarge
JSON metadata.training field exceeds size limit (1 MiB).
NamJsonTrainingTooDeep
JSON metadata.training field exceeds tree depth limit.
NamJsonSubmodelsExceedLimit
JSON config.submodels array exceeds the maximum count (8).
NamJsonSubmodelsTooDeep
JSON config.submodels exceeds container recursion depth limit.
NamJsonWeightNotFinite
JSON weight value is non-finite (NaN, +Inf, -Inf).
NamJsonInvalidSampleRate
JSON sample_rate field contains an invalid value (non-finite or <= 0).
NamJsonUnsupportedTopology
JSON topology exceeds OOM safety limits (MAX_LAYERS or MAX_HIDDEN_SIZE).
NamJsonInvalidVersionFormat
JSON version string is not parseable as SemVer.
NamJsonUnsupportedVersion
JSON version is outside the supported range (min 0.5.0, max 0.7.x).
NamJsonUnsupportedMultiChannel
LSTM model has multi-channel I/O (NAM-rs supports mono only).
NambNonFiniteWeight
NAMB non-finite weight detected in binary weight section.
NambInvalidHeaderField
NAMB header field contains an invalid value (non-finite, <= 0, etc.).
NambCrc32Mismatch
.namb CRC32 checksum does not match expected value.
NambCrc32Missing
CRC32 flag missing in .namb v2+ file (mandatory).
NambInvalidMagic
Invalid .namb magic signature.
NambUnsupportedVersion
Unsupported .namb format version.
NambTruncated
Truncated .namb file (smaller than the minimum header).
UnsupportedArchitecture
Declared neural architecture is not supported (neither WaveNet nor LSTM).
TopologyDetectionFailed
WaveNet/LSTM topology not detectable from the configuration.
WeightCountMismatch
Weight count inconsistent with network geometry.
ModelBuildFailed
Generic failure building the model via the dispatcher.
ModelTooLarge
Model file exceeds the maximum allowed size (256 MiB).
PipewireInitFailed
Failed to initialize PipeWire or create context/core.
StreamConnectFailed
Failed to connect the PipeWire stream.
ResamplerBuildFailed
Failed to build the NamResampler (native Polyphase Sinc).
ResamplerChannelFull
SPSC resampler channel full (rebuild discarded).
SchedFifoDenied
Permission denied for SCHED_FIFO (no RT privileges).
CpuAffinityFailed
Failed to set CPU affinity on the DSP thread.
DeadlineExceeded
PipeWire deadline exceeded (DSP processing exceeded budget).
ParamChannelFull
CLI→DSP parameter SPSC channel full.
InvalidGainValue
Invalid gain value (not a valid f32 number).
UnknownCommand
Unknown CLI command.
CtrlCHandlerFailed
Failed to configure the Ctrl-C handler.
IrLoadFailed
Failed to load a cab-sim impulse response (WAV file).
GcOverflow
Overflow detected in the Garbage Collection (GC) channel.
GcCorrupted
Corrupted GC overflow buffer slot (inconsistent type/pointer).
OutOfMemory
Memory allocation failed (OOM) — layout overflow or allocator exhaustion.
Implementations§
Source§impl NamErrorCode
impl NamErrorCode
Trait Implementations§
Source§impl Clone for NamErrorCode
impl Clone for NamErrorCode
Source§fn clone(&self) -> NamErrorCode
fn clone(&self) -> NamErrorCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NamErrorCode
Source§impl Debug for NamErrorCode
impl Debug for NamErrorCode
Source§impl Display for NamErrorCode
impl Display for NamErrorCode
impl Eq for NamErrorCode
Source§impl Error for NamErrorCode
impl Error for NamErrorCode
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 PartialEq for NamErrorCode
impl PartialEq for NamErrorCode
impl StructuralPartialEq for NamErrorCode
Auto Trait Implementations§
impl Freeze for NamErrorCode
impl RefUnwindSafe for NamErrorCode
impl Send for NamErrorCode
impl Sync for NamErrorCode
impl Unpin for NamErrorCode
impl UnsafeUnpin for NamErrorCode
impl UnwindSafe for NamErrorCode
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
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.