pub struct MemoryFetcher { /* private fields */ }Expand description
In-memory fetcher useful for tests and fixtures.
Implementations§
Source§impl MemoryFetcher
impl MemoryFetcher
Sourcepub fn insert(&mut self, url: IndexUrl, body: impl Into<String>)
pub fn insert(&mut self, url: IndexUrl, body: impl Into<String>)
Registers a response body for a URL.
Sourcepub fn insert_response(&mut self, requested_url: IndexUrl, response: Response)
pub fn insert_response(&mut self, requested_url: IndexUrl, response: Response)
Registers a complete response for a URL.
Sourcepub fn insert_error(&mut self, url: IndexUrl, error: FetchError)
pub fn insert_error(&mut self, url: IndexUrl, error: FetchError)
Registers a deterministic fetch error for a URL.
Sourcepub fn insert_form_response(
&mut self,
submission: &FormSubmission,
response: Response,
)
pub fn insert_form_response( &mut self, submission: &FormSubmission, response: Response, )
Registers a complete response for a resolved form submission.
Sourcepub fn insert_form_error(
&mut self,
submission: &FormSubmission,
error: FetchError,
)
pub fn insert_form_error( &mut self, submission: &FormSubmission, error: FetchError, )
Registers a deterministic form submission error.
Trait Implementations§
Source§impl Clone for MemoryFetcher
impl Clone for MemoryFetcher
Source§fn clone(&self) -> MemoryFetcher
fn clone(&self) -> MemoryFetcher
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 MemoryFetcher
impl Debug for MemoryFetcher
Source§impl Default for MemoryFetcher
impl Default for MemoryFetcher
Source§fn default() -> MemoryFetcher
fn default() -> MemoryFetcher
Returns the “default value” for a type. Read more
Source§impl Fetcher for MemoryFetcher
impl Fetcher for MemoryFetcher
Source§impl FormSubmitter for MemoryFetcher
impl FormSubmitter for MemoryFetcher
Source§fn submit_form(
&self,
submission: &FormSubmission,
) -> Result<Response, FetchError>
fn submit_form( &self, submission: &FormSubmission, ) -> Result<Response, FetchError>
Submits a resolved semantic form request.
Auto Trait Implementations§
impl Freeze for MemoryFetcher
impl RefUnwindSafe for MemoryFetcher
impl Send for MemoryFetcher
impl Sync for MemoryFetcher
impl Unpin for MemoryFetcher
impl UnsafeUnpin for MemoryFetcher
impl UnwindSafe for MemoryFetcher
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