pub struct InterceptRules { /* private fields */ }Expand description
Ordered collection of interception rules.
Implementations§
Source§impl InterceptRules
impl InterceptRules
Sourcepub fn new(rules: Vec<InterceptRule>) -> Result<Self, CamelError>
pub fn new(rules: Vec<InterceptRule>) -> Result<Self, CamelError>
Create rules from a vector.
Validates that every action target starts with mock:.
Returns CamelError::Config that contains the rule index and the
offending target URI when validation fails.
Sourcepub fn lookup(&self, send_uri: &str) -> Option<&InterceptAction>
pub fn lookup(&self, send_uri: &str) -> Option<&InterceptAction>
Return the first matching action for send_uri.
Uses exact string equality and respects declaration order.
Trait Implementations§
Source§impl Clone for InterceptRules
impl Clone for InterceptRules
Source§impl Debug for InterceptRules
impl Debug for InterceptRules
Auto Trait Implementations§
impl Freeze for InterceptRules
impl RefUnwindSafe for InterceptRules
impl Send for InterceptRules
impl Sync for InterceptRules
impl Unpin for InterceptRules
impl UnsafeUnpin for InterceptRules
impl UnwindSafe for InterceptRules
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