pub struct ExternalHandlerResource {
pub url: String,
pub port: u16,
pub capture_file: Option<PathBuf>,
/* private fields */
}Expand description
External handler server resource for testing handler transforms
Fields§
§url: StringThe base URL of the handler server (e.g., “http://127.0.0.1:8080”)
port: u16The port the server is listening on
capture_file: Option<PathBuf>Path to the capture file (if any)
Implementations§
Source§impl ExternalHandlerResource
impl ExternalHandlerResource
Sourcepub async fn with_capture_file(capture_file: Option<PathBuf>) -> Result<Self>
pub async fn with_capture_file(capture_file: Option<PathBuf>) -> Result<Self>
Start a new external handler server with request capture to a file
Sourcepub fn slim_handler_url(&self) -> String
pub fn slim_handler_url(&self) -> String
Get the URL for the slim single-row handler
Sourcepub fn slim_handler_envelope_url(&self) -> String
pub fn slim_handler_envelope_url(&self) -> String
Get the URL for the slim single-row handler with envelope
Sourcepub fn slim_batch_handler_url(&self) -> String
pub fn slim_batch_handler_url(&self) -> String
Get the URL for the slim batch handler
Sourcepub fn slim_batch_handler_envelope_url(&self) -> String
pub fn slim_batch_handler_envelope_url(&self) -> String
Get the URL for the slim batch handler with envelope
Sourcepub fn passthrough_handler_url(&self) -> String
pub fn passthrough_handler_url(&self) -> String
Get the URL for the passthrough handler
Sourcepub fn request_count(&self) -> usize
pub fn request_count(&self) -> usize
Get the number of requests received
Sourcepub fn get_requests(&self) -> Vec<CapturedHandlerRequest>
pub fn get_requests(&self) -> Vec<CapturedHandlerRequest>
Get all captured requests
Sourcepub fn read_captured_file(&self) -> Result<Vec<CapturedHandlerRequest>>
pub fn read_captured_file(&self) -> Result<Vec<CapturedHandlerRequest>>
Read captured requests from the file (if configured)
Auto Trait Implementations§
impl !RefUnwindSafe for ExternalHandlerResource
impl !UnwindSafe for ExternalHandlerResource
impl Freeze for ExternalHandlerResource
impl Send for ExternalHandlerResource
impl Sync for ExternalHandlerResource
impl Unpin for ExternalHandlerResource
impl UnsafeUnpin for ExternalHandlerResource
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.