pub struct AlgorithmMarketplace { /* private fields */ }Expand description
Lightweight synchronous marketplace facade.
Stores algorithm listings in memory and provides CRUD + search + mock execution without requiring an async runtime.
Implementations§
Source§impl AlgorithmMarketplace
impl AlgorithmMarketplace
Sourcepub fn register_algorithm(&self, algo: AlgorithmListing) -> DeviceResult<()>
pub fn register_algorithm(&self, algo: AlgorithmListing) -> DeviceResult<()>
Register a new algorithm.
Fails if an algorithm with the same id is already registered.
Sourcepub fn search_algorithms(
&self,
query: &AlgorithmQuery,
) -> DeviceResult<Vec<AlgorithmListing>>
pub fn search_algorithms( &self, query: &AlgorithmQuery, ) -> DeviceResult<Vec<AlgorithmListing>>
Search for algorithms matching query.
Returns a cloned Vec so the caller does not need to hold any locks.
Sourcepub fn get_algorithm(&self, id: &str) -> DeviceResult<Option<AlgorithmListing>>
pub fn get_algorithm(&self, id: &str) -> DeviceResult<Option<AlgorithmListing>>
Retrieve an algorithm by its exact identifier.
Sourcepub fn deregister_algorithm(&self, id: &str) -> DeviceResult<()>
pub fn deregister_algorithm(&self, id: &str) -> DeviceResult<()>
Remove a previously registered algorithm.
Sourcepub fn execute_algorithm(
&self,
id: &str,
params: AlgorithmParams,
) -> DeviceResult<AlgorithmResult>
pub fn execute_algorithm( &self, id: &str, params: AlgorithmParams, ) -> DeviceResult<AlgorithmResult>
Execute an algorithm by ID with the given parameters.
This is a mock executor: it simulates a uniform distribution over
all 2^n bitstrings (where n is min_qubits for the listing) and
records counts that sum to params.shots. A real implementation
would dispatch to a backend simulator or quantum hardware.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AlgorithmMarketplace
impl RefUnwindSafe for AlgorithmMarketplace
impl Send for AlgorithmMarketplace
impl Sync for AlgorithmMarketplace
impl Unpin for AlgorithmMarketplace
impl UnsafeUnpin for AlgorithmMarketplace
impl UnwindSafe for AlgorithmMarketplace
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.