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§fn clone(&self) -> InterceptRules
fn clone(&self) -> InterceptRules
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 InterceptRules
impl Debug for InterceptRules
Source§impl Default for InterceptRules
impl Default for InterceptRules
Source§fn default() -> InterceptRules
fn default() -> InterceptRules
Returns the “default value” for a type. Read more
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