pub struct RoutingRule {
pub id: String,
pub name: String,
pub pattern: String,
pub priority: Priority,
pub provider: String,
pub model: String,
pub description: Option<String>,
pub tags: Vec<String>,
pub enabled: bool,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A routing rule with pattern matching and priority
Fields§
§id: StringUnique identifier for this rule
name: StringName of the rule (human-readable)
pattern: StringPattern to match (can be regex, exact string, or concept name)
priority: PriorityPriority of this rule (higher = more important)
provider: StringProvider to route to when this rule matches
model: StringModel to use when this rule matches
description: Option<String>Optional description of when this rule applies
Tags for categorizing rules
enabled: boolWhether this rule is enabled
created_at: DateTime<Utc>When this rule was created
updated_at: DateTime<Utc>When this rule was last updated
Implementations§
Source§impl RoutingRule
impl RoutingRule
Sourcepub fn new(
id: String,
name: String,
pattern: String,
priority: Priority,
provider: String,
model: String,
) -> Self
pub fn new( id: String, name: String, pattern: String, priority: Priority, provider: String, model: String, ) -> Self
Create a new routing rule
Sourcepub fn with_defaults(
id: String,
name: String,
pattern: String,
provider: String,
model: String,
) -> Self
pub fn with_defaults( id: String, name: String, pattern: String, provider: String, model: String, ) -> Self
Create a rule with default medium priority
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
Set the description
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Set enabled status
Trait Implementations§
Source§impl Clone for RoutingRule
impl Clone for RoutingRule
Source§fn clone(&self) -> RoutingRule
fn clone(&self) -> RoutingRule
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 RoutingRule
impl Debug for RoutingRule
Source§impl<'de> Deserialize<'de> for RoutingRule
impl<'de> Deserialize<'de> for RoutingRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RoutingRule
impl PartialEq for RoutingRule
Source§impl Serialize for RoutingRule
impl Serialize for RoutingRule
impl Eq for RoutingRule
impl StructuralPartialEq for RoutingRule
Auto Trait Implementations§
impl Freeze for RoutingRule
impl RefUnwindSafe for RoutingRule
impl Send for RoutingRule
impl Sync for RoutingRule
impl Unpin for RoutingRule
impl UnwindSafe for RoutingRule
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