pub trait Oracle<Candidate> {
// Required method
fn accepts(&self, candidate: &Candidate) -> bool;
}Expand description
A predicate that marks valid candidates, the oracle of a quantum search.
The predicate must be pure: the same candidate always gets the same answer, since the algorithms count oracle queries.
Required Methods§
Sourcefn accepts(&self, candidate: &Candidate) -> bool
fn accepts(&self, candidate: &Candidate) -> bool
Whether candidate is a solution.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<Candidate, O: Oracle<Candidate> + ?Sized> Oracle<Candidate> for &O
A reference to an oracle is an oracle, so a PhaseOracle can borrow one.
impl<Candidate, O: Oracle<Candidate> + ?Sized> Oracle<Candidate> for &O
A reference to an oracle is an oracle, so a PhaseOracle can borrow one.