caco 0.5.33

library for dealing with doom [et al] wad files
Documentation
use crate::agnostic::{ClumpMut, Entity, FlatClodMut, phantoms::PhantomDirectory};

/// Mutable version of the [`Clod`](crate::agnostic::Clod) trait.
pub trait ClodMut<C: ClumpMut, D> {
    /// Mutably borrow a single entity by number.
    fn nth_ent_mut(&mut self, n: usize) -> &mut impl Entity<C, D>;

    //// Mutably borrows many entities by numbers. The range may be non-contiguous. The returned entities are always
    /// in numerically increasing order, and are not duplicated, regardless of the ordering or
    /// overlapping of the provided range(s).
    fn a_sub_nth_ents_mut(&mut self, a: impl Iterator<Item = usize>) -> Vec<&mut impl Entity<C, D>>;
}

impl<C: ClumpMut, M: FlatClodMut<C>> ClodMut<C, PhantomDirectory> for M {
    #[allow(refining_impl_trait)]
    fn nth_ent_mut(&mut self, n: usize) -> &mut C {
        self.nth_clump_mut(n)
    }

    #[allow(refining_impl_trait)]
    fn a_sub_nth_ents_mut(&mut self, a: impl Iterator<Item = usize>) -> Vec<&mut C> {
        self.a_sub_nth_clumps_mut(a)
    }
}