pub(crate) trait StudyRegistry {
// Required methods
fn allowance(&self, operation: RegistryOperation) -> usize;
fn roster_request_size(&self) -> usize;
async fn resolve_persons<K>(
&mut self,
entries: Vec<BatchEntry<K, PersonLookup>>,
options: BatchOptions,
) -> BatchReply<K, PersonLookup, PersonAnswer>;
async fn resolve_enrolments<K>(
&mut self,
entries: Vec<BatchEntry<K, EnrolmentLookup>>,
options: BatchOptions,
) -> BatchReply<K, EnrolmentLookup, EnrolmentAnswer>;
async fn import_attainments<K>(
&mut self,
entries: Vec<BatchEntry<K, AttainmentSubmission>>,
options: BatchOptions,
) -> BatchReply<K, AttainmentSubmission, ImportAnswer>;
async fn verify_attainments<K>(
&mut self,
entries: Vec<BatchEntry<K, VerificationRequest>>,
options: BatchOptions,
) -> BatchReply<K, VerificationRequest, VerificationAnswer>;
async fn list_course_roster(
&mut self,
request: &[RosterCode],
) -> Result<RosterListing, RegistryError>;
async fn validate_course_codes(
&mut self,
codes: &[CourseCode],
) -> Result<HashMap<CourseCode, CourseCodeVerdict>, RegistryError>;
}Expand description
The study registry a phase iteration asks, through its limiter and breakers. The seam a
use-case test would fake; only the Suotar adapter implements it. Generic rather than dyn.
The batch operations each send one request and hand every row they were given back, answered or refused.
Required Methods§
Sourcefn allowance(&self, operation: RegistryOperation) -> usize
fn allowance(&self, operation: RegistryOperation) -> usize
How many items the next request of operation may carry, or for a roster listing how many
requests may go out. 0 means send nothing this iteration.
Sourcefn roster_request_size(&self) -> usize
fn roster_request_size(&self) -> usize
How many course codes one roster listing request may carry: the registry’s batch size, or one while a breaker’s probe lets a single item through.
async fn resolve_persons<K>( &mut self, entries: Vec<BatchEntry<K, PersonLookup>>, options: BatchOptions, ) -> BatchReply<K, PersonLookup, PersonAnswer>
async fn resolve_enrolments<K>( &mut self, entries: Vec<BatchEntry<K, EnrolmentLookup>>, options: BatchOptions, ) -> BatchReply<K, EnrolmentLookup, EnrolmentAnswer>
Sourceasync fn import_attainments<K>(
&mut self,
entries: Vec<BatchEntry<K, AttainmentSubmission>>,
options: BatchOptions,
) -> BatchReply<K, AttainmentSubmission, ImportAnswer>
async fn import_attainments<K>( &mut self, entries: Vec<BatchEntry<K, AttainmentSubmission>>, options: BatchOptions, ) -> BatchReply<K, AttainmentSubmission, ImportAnswer>
The one operation that creates something: a row it leaves unanswered may have landed.
async fn verify_attainments<K>( &mut self, entries: Vec<BatchEntry<K, VerificationRequest>>, options: BatchOptions, ) -> BatchReply<K, VerificationRequest, VerificationAnswer>
Sourceasync fn list_course_roster(
&mut self,
request: &[RosterCode],
) -> Result<RosterListing, RegistryError>
async fn list_course_roster( &mut self, request: &[RosterCode], ) -> Result<RosterListing, RegistryError>
One list-by-course request, spending one request of the allowance.
Sourceasync fn validate_course_codes(
&mut self,
codes: &[CourseCode],
) -> Result<HashMap<CourseCode, CourseCodeVerdict>, RegistryError>
async fn validate_course_codes( &mut self, codes: &[CourseCode], ) -> Result<HashMap<CourseCode, CourseCodeVerdict>, RegistryError>
Validates codes in requests as large as the allowance lets, until either runs out. On the
first refused request the verdicts gathered so far are dropped.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.