Skip to main content

NamErrorCode

Enum NamErrorCode 

Source
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

Source

pub fn code(self) -> &'static str

Returns the numeric code in “Exxxx” format.

Source

pub fn message(self) -> &'static str

Returns a human-readable message for GUI display.

Source

pub fn mnemonic(self) -> &'static str

Returns the human-readable mnemonic name (SCREAMING_SNAKE_CASE) of the code.

Trait Implementations§

Source§

impl Clone for NamErrorCode

Source§

fn clone(&self) -> NamErrorCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NamErrorCode

Source§

impl Debug for NamErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for NamErrorCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for NamErrorCode

Source§

impl Error for NamErrorCode

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for NamErrorCode

Source§

fn eq(&self, other: &NamErrorCode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NamErrorCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.