pub struct BoxedSpecification<T: ?Sized> { /* private fields */ }Expand description
An explicitly type-erased, owned specification.
Use this wrapper only when a runtime-selected or heterogeneous collection of rules is needed. Static composition remains the allocation-free default.
Implementations§
Source§impl<T: ?Sized> BoxedSpecification<T>
impl<T: ?Sized> BoxedSpecification<T>
Sourcepub fn new<Concrete>(specification: Concrete) -> Selfwhere
Concrete: Specification<T> + 'static,
pub fn new<Concrete>(specification: Concrete) -> Selfwhere
Concrete: Specification<T> + 'static,
Erases the concrete type of specification and takes ownership of it.
Trait Implementations§
Source§impl<T: ?Sized> Specification<T> for BoxedSpecification<T>
impl<T: ?Sized> Specification<T> for BoxedSpecification<T>
Source§fn is_satisfied_by(&self, candidate: &T) -> bool
fn is_satisfied_by(&self, candidate: &T) -> bool
Returns whether
candidate satisfies this rule.Source§fn and<Other>(self, other: Other) -> And<Self, Other>where
Self: Sized,
Other: Specification<T>,
fn and<Other>(self, other: Other) -> And<Self, Other>where
Self: Sized,
Other: Specification<T>,
Combines this rule with
other using short-circuiting logical AND. Read moreAuto Trait Implementations§
impl<T> !RefUnwindSafe for BoxedSpecification<T>
impl<T> !Send for BoxedSpecification<T>
impl<T> !Sync for BoxedSpecification<T>
impl<T> !UnwindSafe for BoxedSpecification<T>
impl<T> Freeze for BoxedSpecification<T>where
T: ?Sized,
impl<T> Unpin for BoxedSpecification<T>where
T: ?Sized,
impl<T> UnsafeUnpin for BoxedSpecification<T>where
T: ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more