use super::{CollectorBase, IntoCollectorBase};
#[allow(private_bounds)]
pub trait CollectorByMut: Sealed {
type CollectorMut<'a>: CollectorBase
where
Self: 'a;
fn collector_mut(&mut self) -> Self::CollectorMut<'_>;
}
impl<T> CollectorByMut for T
where
T: ?Sized,
for<'a> &'a mut T: IntoCollectorBase,
{
type CollectorMut<'a>
= <&'a mut T as IntoCollectorBase>::IntoCollector
where
T: 'a;
#[inline]
fn collector_mut(&mut self) -> Self::CollectorMut<'_> {
self.into_collector()
}
}
trait Sealed {}
impl<T> Sealed for T
where
T: ?Sized,
for<'a> &'a mut T: IntoCollectorBase,
{
}