pub struct ResponseRegistry { /* private fields */ }Expand description
Registry of URL patterns → fake responses.
Researchers configure this to simulate specific server behaviors:
- C2 communication patterns
- Login page responses
- Redirect chains
Implementations§
Source§impl ResponseRegistry
impl ResponseRegistry
pub fn new() -> Self
Sourcepub fn add_exact(&mut self, url: impl Into<String>, response: FakeResponse)
pub fn add_exact(&mut self, url: impl Into<String>, response: FakeResponse)
Register a response for an exact URL.
Sourcepub fn add_prefix(&mut self, prefix: impl Into<String>, response: FakeResponse)
pub fn add_prefix(&mut self, prefix: impl Into<String>, response: FakeResponse)
Register a response for all URLs starting with prefix.
Sourcepub fn set_fallback(&mut self, response: FakeResponse)
pub fn set_fallback(&mut self, response: FakeResponse)
Set the fallback response for unmatched URLs.
Sourcepub fn get(&self, url: &str) -> FakeResponse
pub fn get(&self, url: &str) -> FakeResponse
Look up the response for a URL.
Trait Implementations§
Source§impl Debug for ResponseRegistry
impl Debug for ResponseRegistry
Source§impl Default for ResponseRegistry
impl Default for ResponseRegistry
Source§fn default() -> ResponseRegistry
fn default() -> ResponseRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResponseRegistry
impl RefUnwindSafe for ResponseRegistry
impl Send for ResponseRegistry
impl Sync for ResponseRegistry
impl Unpin for ResponseRegistry
impl UnsafeUnpin for ResponseRegistry
impl UnwindSafe for ResponseRegistry
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> 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