use super::super::predicates::Projection;
pub struct Policy<'a, P> {
pub(super) positions: super::super::value::PlaceholderPositions<'a>,
pub(super) projection: &'a P,
pub(super) narrowed: bool,
}
impl<P> Copy for Policy<'_, P> {}
impl<P> Clone for Policy<'_, P> {
fn clone(&self) -> Self {
*self
}
}
pub fn policy<'a, P: Projection>(
positions: super::super::value::PlaceholderPositions<'a>,
projection: &'a P,
) -> Policy<'a, P> {
Policy {
positions,
projection,
narrowed: false,
}
}
impl<P> Policy<'_, P> {
pub(super) fn with_narrowed(self, narrowed: bool) -> Self {
Self { narrowed, ..self }
}
}