firefly-audio 0.3.1

Tree-based generator and processor for sound. Powers audio in Firefly Zero.
Documentation
use core::fmt;

#[derive(Debug)]
pub enum NodeError {
    TooManyChildren,
    TooManyNodes,
    UnknownID(u32),
}

impl core::error::Error for NodeError {}

impl fmt::Display for NodeError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::TooManyChildren => write!(f, "the node has too many children"),
            Self::TooManyNodes => write!(f, "the tree has too many nodes"),
            Self::UnknownID(id) => write!(f, "there is no node with id {id}"),
        }
    }
}