pub struct PriorityService { /* private fields */ }Expand description
Service for computing and optimizing priorities based on business rules
Implementations§
Source§impl PriorityService
impl PriorityService
Sourcepub fn with_default_priority(default_priority: Priority) -> Self
pub fn with_default_priority(default_priority: Priority) -> Self
Create priority service with custom default
Sourcepub fn add_field_rule(&mut self, field_name: String, priority: Priority)
pub fn add_field_rule(&mut self, field_name: String, priority: Priority)
Add field-based priority rule
Sourcepub fn add_path_rule(&mut self, path_pattern: String, priority: Priority)
pub fn add_path_rule(&mut self, path_pattern: String, priority: Priority)
Add path-based priority rule (more specific than field rules)
Sourcepub fn add_type_rule(&mut self, type_name: String, priority: Priority)
pub fn add_type_rule(&mut self, type_name: String, priority: Priority)
Add type-based priority rule
Sourcepub fn calculate_priority(&self, path: &JsonPath, value: &JsonValue) -> Priority
pub fn calculate_priority(&self, path: &JsonPath, value: &JsonValue) -> Priority
Calculate priority for a specific JSON path and value
Sourcepub fn calculate_priorities(
&self,
data: &JsonValue,
) -> DomainResult<HashMap<JsonPath, Priority>>
pub fn calculate_priorities( &self, data: &JsonValue, ) -> DomainResult<HashMap<JsonPath, Priority>>
Calculate priorities for all fields in a JSON object
Sourcepub fn optimize_rules(&mut self, usage_stats: &UsageStatistics)
pub fn optimize_rules(&mut self, usage_stats: &UsageStatistics)
Update priority rules based on usage statistics
Sourcepub fn get_rules_summary(&self) -> PriorityRulesSummary
pub fn get_rules_summary(&self) -> PriorityRulesSummary
Get priority rules summary
Trait Implementations§
Source§impl Clone for PriorityService
impl Clone for PriorityService
Source§fn clone(&self) -> PriorityService
fn clone(&self) -> PriorityService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriorityService
impl Debug for PriorityService
Auto Trait Implementations§
impl Freeze for PriorityService
impl RefUnwindSafe for PriorityService
impl Send for PriorityService
impl Sync for PriorityService
impl Unpin for PriorityService
impl UnwindSafe for PriorityService
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more