TopoVec
This commit is contained in:
parent
59f195609e
commit
62c2192541
@ -45,7 +45,7 @@ pub use self::resolution::{
|
|||||||
};
|
};
|
||||||
pub use self::singular::{SingularError, SingularResolution};
|
pub use self::singular::{SingularError, SingularResolution};
|
||||||
pub use self::to_hex::hex;
|
pub use self::to_hex::hex;
|
||||||
pub use self::topology::MentionableTop;
|
pub use self::topology::{MentionableTop, TopoVec};
|
||||||
|
|
||||||
/// Helper alias for [`WeakFunctor::F`] of [`FunctorContext::T`].
|
/// Helper alias for [`WeakFunctor::F`] of [`FunctorContext::T`].
|
||||||
///
|
///
|
||||||
|
@ -54,9 +54,3 @@ impl Display for SingularError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Error for SingularError {}
|
impl Error for SingularError {}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>> PointsVisitor<'a, Ctx> for Vec<Arc<dyn SingularResolution<'a, Ctx>>> {
|
|
||||||
fn visit<A: Mentionable<'a, Ctx>>(&mut self, point: &Point<'a, Ctx, A>) {
|
|
||||||
self.push(Arc::new(point.clone()) as _);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -19,3 +19,11 @@ pub trait MentionableTop<'a, Ctx: Context<'a>>: 'a {
|
|||||||
where
|
where
|
||||||
Self: Mentionable<'a, Ctx>;
|
Self: Mentionable<'a, Ctx>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type TopoVec<'a, Ctx> = Vec<Arc<dyn SingularResolution<'a, Ctx>>>;
|
||||||
|
|
||||||
|
impl<'a, Ctx: Context<'a>> PointsVisitor<'a, Ctx> for TopoVec<'a, Ctx> {
|
||||||
|
fn visit<A: Mentionable<'a, Ctx>>(&mut self, point: &Point<'a, Ctx, A>) {
|
||||||
|
self.push(Arc::new(point.clone()) as _);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -18,7 +18,7 @@ use super::*;
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
pub struct SingularResolver<'a, Ctx: Context<'a>> {
|
pub struct SingularResolver<'a, Ctx: Context<'a>> {
|
||||||
points: Vec<Arc<dyn SingularResolution<'a, Ctx>>>,
|
points: TopoVec<'a, Ctx>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Ctx: Context<'a>> SingularResolver<'a, Ctx> {
|
impl<'a, Ctx: Context<'a>> SingularResolver<'a, Ctx> {
|
||||||
|
Loading…
Reference in New Issue
Block a user