Skip to main content

VictauriClient

Struct VictauriClient 

Source
pub struct VictauriClient { /* private fields */ }
Expand description

Typed HTTP client for the Victauri MCP server.

Manages session lifecycle (initialize → tool calls → cleanup) and provides convenient methods for common test operations.

Implementations§

Source§

impl VictauriClient

Source

pub async fn connect(port: u16) -> Result<Self, TestError>

Connect to a Victauri MCP server on the given port. Sends initialize and notifications/initialized automatically.

§Errors

Returns TestError::Connection if the server is unreachable or returns a non-success status. Returns TestError::Request on HTTP transport failures.

Source

pub async fn connect_with_token( port: u16, token: Option<&str>, ) -> Result<Self, TestError>

Connect with an optional Bearer auth token.

Retries up to 3 times with exponential backoff on 429 (rate limited).

§Errors

Returns TestError::Connection if the server is unreachable or returns a non-success status. Returns TestError::Request on HTTP transport failures.

Source

pub async fn discover() -> Result<Self, TestError>

Auto-discover a running Victauri server via temp files.

Discovery priority:

  1. VICTAURI_PORT / VICTAURI_AUTH_TOKEN env vars (explicit override)
  2. Per-process discovery directory: <temp>/victauri/<pid>/port
  3. Default: port 7373, no auth
§Errors

Returns TestError::Connection if the server is unreachable or returns a non-success status. Returns TestError::Request on HTTP transport failures.

Source

pub async fn is_alive(&self) -> bool

Check whether the server is still reachable.

Sends a GET to /health and returns true if the response is 200 OK.

Source

pub async fn reconnect(&self, max_wait: Duration) -> Result<Self, TestError>

Re-establish an MCP session after the app restarts.

Polls /health up to max_wait and then re-runs the initialize/initialized handshake. The returned client has a fresh session ID; the old client should be dropped.

§Errors

Returns TestError::Connection if the server doesn’t come back within max_wait.

Source

pub async fn call_tool( &mut self, name: &str, arguments: Value, ) -> Result<Value, TestError>

Call an MCP tool by name and return the result content as JSON.

Retries up to 3 times with exponential backoff on 429 (rate limited).

§Errors

Returns TestError::Connection if the request fails after retries. Returns TestError::Request on HTTP transport errors. Returns TestError::Mcp if the server returns a JSON-RPC error.

Source

pub async fn eval_js(&mut self, code: &str) -> Result<Value, TestError>

Evaluate JavaScript in the webview and return the result.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn dom_snapshot(&mut self) -> Result<Value, TestError>

Get a DOM snapshot of the current page.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn dom_snapshot_for( &mut self, label: &str, ) -> Result<Value, TestError>

Get a DOM snapshot of a specific webview by label.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn screenshot_for(&mut self, label: &str) -> Result<Value, TestError>

Capture a screenshot of a specific webview by label.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn click(&mut self, ref_id: &str) -> Result<Value, TestError>

Click an element by ref handle ID.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn fill( &mut self, ref_id: &str, value: &str, ) -> Result<Value, TestError>

Fill an input element with a value.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn type_text( &mut self, ref_id: &str, text: &str, ) -> Result<Value, TestError>

Type text into an element character by character.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn list_windows(&mut self) -> Result<Value, TestError>

List all window labels.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_window_state( &mut self, label: Option<&str>, ) -> Result<Value, TestError>

Get the state of a specific window (or all windows).

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn screenshot(&mut self) -> Result<Value, TestError>

Take a screenshot and return base64-encoded PNG.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn screenshot_visual( &mut self, name: &str, options: &VisualOptions, ) -> Result<VisualDiff, TestError>

Take a screenshot and compare it against a stored baseline.

Captures the current window, extracts the base64 PNG data, and passes it to visual::compare_screenshot. On first run the screenshot is saved as the new baseline.

§Errors

Returns TestError::VisualRegression if the diff exceeds the threshold, or TestError::Other if the screenshot result does not contain recognizable image data.

Source

pub async fn invoke_command( &mut self, command: &str, args: Option<Value>, ) -> Result<Value, TestError>

Invoke a Tauri command by name with optional arguments.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_ipc_log( &mut self, limit: Option<usize>, ) -> Result<Value, TestError>

Get the IPC call log.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn verify_state( &mut self, frontend_expr: &str, backend_state: Value, ) -> Result<Value, TestError>

Verify frontend state against backend state.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn detect_ghost_commands(&mut self) -> Result<Value, TestError>

Detect ghost commands (registered but never called, or called but not registered).

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn check_ipc_integrity(&mut self) -> Result<Value, TestError>

Check IPC call health (pending, stale, errored).

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn assert_semantic( &mut self, expression: &str, label: &str, condition: &str, expected: Value, ) -> Result<Value, TestError>

Run a semantic assertion against a JS expression.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn audit_accessibility(&mut self) -> Result<Value, TestError>

Run an accessibility audit.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_performance_metrics(&mut self) -> Result<Value, TestError>

Get performance metrics (timing, heap, resources).

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_registry(&mut self) -> Result<Value, TestError>

Get the command registry.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_memory_stats(&mut self) -> Result<Value, TestError>

Get process memory statistics.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_plugin_info(&mut self) -> Result<Value, TestError>

Read plugin info (version, uptime, tool count).

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_diagnostics(&mut self) -> Result<Value, TestError>

Run environment diagnostics to detect potential compatibility issues.

Checks for service workers, closed shadow DOM, iframes, large DOM, and CSP status. Returns warnings and environment info.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn wait_for( &mut self, condition: &str, value: Option<&str>, timeout_ms: Option<u64>, poll_ms: Option<u64>, ) -> Result<Value, TestError>

Wait for a condition to be met, polling at an interval.

Conditions: text, text_gone, selector, selector_gone, url, ipc_idle, network_idle.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn start_recording( &mut self, session_id: Option<&str>, ) -> Result<Value, TestError>

Start a time-travel recording session.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn stop_recording(&mut self) -> Result<Value, TestError>

Stop the recording and return the session.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn export_session(&mut self) -> Result<Value, TestError>

Export the current recording session as JSON.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn find_elements(&mut self, query: Value) -> Result<Value, TestError>

Search for elements by various criteria without a full snapshot.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn double_click(&mut self, ref_id: &str) -> Result<Value, TestError>

Double-click an element by ref handle ID.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn hover(&mut self, ref_id: &str) -> Result<Value, TestError>

Hover over an element by ref handle.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn focus(&mut self, ref_id: &str) -> Result<Value, TestError>

Focus an element by ref handle.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn press_key(&mut self, key: &str) -> Result<Value, TestError>

Press a keyboard key.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn navigate(&mut self, url: &str) -> Result<Value, TestError>

Navigate to a URL.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn logs( &mut self, action: &str, limit: Option<usize>, ) -> Result<Value, TestError>

Get logs by type (console, network, ipc, navigation, dialogs).

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn scroll_to(&mut self, ref_id: &str) -> Result<Value, TestError>

Scroll an element into view by ref handle.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn select_option( &mut self, ref_id: &str, values: &[&str], ) -> Result<Value, TestError>

Select option(s) in a <select> element.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub fn base_url(&self) -> &str

Get the server base URL.

Source

pub fn host(&self) -> &str

Get the host the client is connected to.

Source

pub fn port(&self) -> u16

Get the port the client is connected to.

Source

pub fn session_id(&self) -> &str

Get the MCP session ID.

Source

pub async fn get_ipc_calls( &mut self, command: &str, ) -> Result<Vec<Value>, TestError>

👎Deprecated since 0.2.0:

renamed to get_ipc_calls_for

Get IPC calls filtered to a specific command.

Returns a Vec of all IPC log entries matching the given command name.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn ipc_calls_since( &mut self, checkpoint: usize, ) -> Result<Vec<Value>, TestError>

👎Deprecated since 0.2.0:

renamed to get_ipc_calls_since

Get IPC calls made since a previous checkpoint.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_ipc_calls_for( &mut self, command: &str, ) -> Result<Vec<Value>, TestError>

Filter the IPC log for calls to a specific command.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn get_ipc_calls_since( &mut self, checkpoint: usize, ) -> Result<Vec<Value>, TestError>

Get IPC calls made since a previous checkpoint.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub fn wait(&mut self, condition: &str) -> WaitForBuilder<'_>

Start a builder-style wait for a condition.

This is a fluent alternative to VictauriClient::wait_for that avoids positional Option arguments.

§Examples
client.wait("text")
    .value("Welcome")
    .timeout_ms(5000)
    .run()
    .await
    .unwrap();
Source

pub async fn ipc_checkpoint(&mut self) -> Result<usize, TestError>

👎Deprecated since 0.2.0:

renamed to create_ipc_checkpoint

Snapshot the current IPC log length, for use with ipc_calls_since.

Prefer VictauriClient::create_ipc_checkpoint — this alias exists for backwards compatibility.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn create_ipc_checkpoint(&mut self) -> Result<usize, TestError>

Snapshot the current IPC log length, for use with ipc_calls_since.

Returns the number of IPC calls recorded so far. Pass this value to VictauriClient::ipc_calls_since to get only the calls that occurred after the checkpoint.

§Errors

Returns errors from VictauriClient::call_tool.

Source

pub async fn plugin_info(&mut self) -> Result<PluginInfo, TestError>

Read plugin info as a typed PluginInfo struct.

This is a typed alternative to VictauriClient::get_plugin_info which returns raw JSON.

§Errors

Returns TestError::Other if the response cannot be deserialized. Returns other errors from VictauriClient::call_tool.

Source

pub async fn memory_stats(&mut self) -> Result<MemoryStats, TestError>

Read process memory statistics as a typed MemoryStats struct.

This is a typed alternative to VictauriClient::get_memory_stats which returns raw JSON.

§Errors

Returns TestError::Other if the response cannot be deserialized. Returns other errors from VictauriClient::call_tool.

Source

pub fn verify(&mut self) -> VerifyBuilder<'_>

Start a fluent verification chain that checks multiple conditions at once.

Unlike individual assertions that panic on failure, verify() collects all results and reports them together — making test failures more informative and reducing test reruns.

§Examples
let report = client.verify()
    .has_text("Welcome")
    .ipc_was_called("greet")
    .no_console_errors()
    .run()
    .await
    .unwrap();
report.assert_all_passed();
Source

pub async fn click_by_text(&mut self, text: &str) -> Result<Value, TestError>

Click the first element whose accessible text contains the given string.

Takes a DOM snapshot, finds the element, and clicks it.

§Errors

Returns TestError::ElementNotFound if no matching element is found. Returns other errors from VictauriClient::call_tool.

Source

pub async fn click_by_id(&mut self, id: &str) -> Result<Value, TestError>

Click the element with the given HTML id attribute.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn double_click_by_text( &mut self, text: &str, ) -> Result<Value, TestError>

Double-click the first element whose accessible text contains the given string.

§Errors

Returns TestError::ElementNotFound if no matching element is found. Returns other errors from VictauriClient::call_tool.

Source

pub async fn double_click_by_id(&mut self, id: &str) -> Result<Value, TestError>

Double-click the element with the given HTML id attribute.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn double_click_by_selector( &mut self, selector: &str, ) -> Result<Value, TestError>

Double-click the first element matching a CSS selector.

Resolves the selector via find_elements, then double-clicks the first match.

§Errors

Returns TestError::ElementNotFound if no element matches the selector. Returns other errors from VictauriClient::call_tool.

Source

pub async fn click_by_selector( &mut self, selector: &str, ) -> Result<Value, TestError>

Click the first element matching a CSS selector.

Resolves the selector via find_elements, then clicks the first match.

§Errors

Returns TestError::ElementNotFound if no element matches the selector. Returns other errors from VictauriClient::call_tool.

Source

pub async fn fill_by_id( &mut self, id: &str, value: &str, ) -> Result<Value, TestError>

Fill an input identified by HTML id with the given value.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn fill_by_text( &mut self, text: &str, value: &str, ) -> Result<Value, TestError>

Fill an input whose accessible text contains the given string.

§Errors

Returns TestError::ElementNotFound if no matching element is found. Returns other errors from VictauriClient::call_tool.

Source

pub async fn fill_by_selector( &mut self, selector: &str, value: &str, ) -> Result<Value, TestError>

Fill an input matching a CSS selector with the given value.

Resolves the selector via find_elements, then fills the first match.

§Errors

Returns TestError::ElementNotFound if no element matches the selector. Returns other errors from VictauriClient::call_tool.

Source

pub async fn type_by_id( &mut self, id: &str, text: &str, ) -> Result<Value, TestError>

Type text into an input identified by HTML id, character by character.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn expect_text(&mut self, text: &str) -> Result<(), TestError>

Wait until the page contains the given text (polls DOM snapshots).

Default timeout: 5000ms, poll interval: 200ms.

§Errors

Returns TestError::Timeout if the text doesn’t appear within the timeout. Returns other errors from VictauriClient::call_tool.

Source

pub async fn expect_text_with_timeout( &mut self, text: &str, timeout_ms: u64, ) -> Result<(), TestError>

Wait until the page contains the given text, with a custom timeout in ms.

§Errors

Returns TestError::Timeout if the text doesn’t appear within the timeout. Returns other errors from VictauriClient::call_tool.

Source

pub async fn expect_no_text(&mut self, text: &str) -> Result<(), TestError>

Wait until the page no longer contains the given text.

Default timeout: 3000ms, poll interval: 200ms.

§Errors

Returns TestError::Timeout if the text is still present after the timeout. Returns other errors from VictauriClient::call_tool.

Source

pub async fn select_by_id( &mut self, id: &str, value: &str, ) -> Result<Value, TestError>

Select an option in a <select> element identified by HTML id.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn select_option_by_id( &mut self, id: &str, values: &[&str], ) -> Result<Value, TestError>

Select option(s) in a <select> element identified by HTML id.

Accepts multiple values for multi-select elements.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn select_option_by_text( &mut self, text: &str, values: &[&str], ) -> Result<Value, TestError>

Select option(s) in a <select> element whose accessible text contains the given string.

§Errors

Returns TestError::ElementNotFound if no matching element is found. Returns other errors from VictauriClient::call_tool.

Source

pub async fn select_option_by_selector( &mut self, selector: &str, values: &[&str], ) -> Result<Value, TestError>

Select option(s) in a <select> element matching a CSS selector.

Resolves the selector via find_elements, then selects in the first match.

§Errors

Returns TestError::ElementNotFound if no element matches the selector. Returns other errors from VictauriClient::call_tool.

Source

pub async fn scroll_to_by_selector( &mut self, selector: &str, ) -> Result<Value, TestError>

Scroll an element matching a CSS selector into view.

Resolves the selector via find_elements, then scrolls the first match.

§Errors

Returns TestError::ElementNotFound if no element matches the selector. Returns other errors from VictauriClient::call_tool.

Source

pub async fn scroll_to_by_id(&mut self, id: &str) -> Result<Value, TestError>

Scroll an element with the given HTML id into view.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub async fn text_by_id(&mut self, id: &str) -> Result<String, TestError>

Get the text content of an element identified by HTML id.

§Errors

Returns TestError::ElementNotFound if no element has the given id. Returns other errors from VictauriClient::call_tool.

Source

pub fn get_by_role(&self, role: &str) -> Locator

Create a Locator matching elements by ARIA role.

Equivalent to Playwright’s page.getByRole().

Source

pub fn get_by_text(&self, text: &str) -> Locator

Create a Locator matching elements by visible text content.

Equivalent to Playwright’s page.getByText().

Source

pub fn get_by_test_id(&self, id: &str) -> Locator

Create a Locator matching elements by data-testid attribute.

Equivalent to Playwright’s page.getByTestId().

Source

pub fn get_by_label(&self, text: &str) -> Locator

Create a Locator matching form controls by associated label text.

Equivalent to Playwright’s page.getByLabel().

Source

pub fn get_by_placeholder(&self, text: &str) -> Locator

Create a Locator matching elements by placeholder text.

Equivalent to Playwright’s page.getByPlaceholder().

Source

pub fn locator(&self, css: &str) -> Locator

Create a Locator matching elements by CSS selector.

Equivalent to Playwright’s page.locator().

Source

pub fn get_by_alt_text(&self, alt: &str) -> Locator

Create a Locator matching elements by alt text (images).

Equivalent to Playwright’s page.getByAltText().

Source

pub fn get_by_title(&self, title: &str) -> Locator

Create a Locator matching elements by title attribute.

Equivalent to Playwright’s page.getByTitle().

Source

pub async fn screenshot_to_file( &mut self, path: impl AsRef<Path>, ) -> Result<PathBuf, TestError>

Take a screenshot and save it to a file on disk.

Captures the default window, decodes the base64 PNG, and writes it to the given path. Returns the canonical path of the saved file.

§Errors

Returns TestError::Other if the screenshot cannot be captured, decoded, or written to disk.

Source

pub async fn screenshot_to_file_for( &mut self, label: &str, path: impl AsRef<Path>, ) -> Result<PathBuf, TestError>

Take a screenshot of a specific window and save it to a file.

§Errors

Returns TestError::Other if the screenshot cannot be captured, decoded, or written to disk.

Source§

impl VictauriClient

Source

pub async fn assert_eval_works(&mut self) -> Result<(), TestError>

Assert that JavaScript evaluation works (evaluates 1+1).

§Errors

Returns TestError::Assertion if evaluation returns the wrong result.

Source

pub async fn assert_dom_snapshot_valid(&mut self) -> Result<(), TestError>

Assert that DOM snapshot returns a valid tree with elements.

§Errors

Returns TestError::Assertion if the snapshot is empty or malformed.

Source

pub async fn assert_screenshot_ok(&mut self) -> Result<(), TestError>

Assert that screenshot captures window image data.

§Errors

Returns TestError::Assertion if no image data in the response.

Source

pub async fn assert_windows_exist(&mut self) -> Result<(), TestError>

Assert that at least one window exists.

§Errors

Returns TestError::Assertion if no windows are found.

Source

pub async fn assert_ipc_integrity_ok(&mut self) -> Result<(), TestError>

Assert that IPC integrity is healthy.

§Errors

Returns TestError::Assertion if the IPC integrity check reports stale or errored calls.

Source

pub async fn assert_accessible(&mut self) -> Result<(), TestError>

Assert that the accessibility audit has zero violations.

§Errors

Returns TestError::Assertion if any a11y violations are found.

Source

pub async fn assert_dom_complete_under( &mut self, max: Duration, ) -> Result<(), TestError>

Assert DOM complete time is under the given duration.

Passes silently if the browser does not expose navigation timing.

§Errors

Returns TestError::Assertion if load time exceeds the budget.

Source

pub async fn assert_heap_under_mb( &mut self, max_mb: f64, ) -> Result<(), TestError>

Assert JS heap usage is under the given megabyte limit.

Passes silently if the browser does not expose heap metrics.

§Errors

Returns TestError::Assertion if heap exceeds the budget.

Source

pub async fn assert_no_uncaught_errors(&mut self) -> Result<(), TestError>

Assert there are no uncaught errors in the console log.

Checks for entries with [uncaught] prefix (from the JS bridge’s window.onerror and unhandledrejection handlers).

§Errors

Returns TestError::Assertion if uncaught errors are found.

Source

pub async fn assert_recording_lifecycle(&mut self) -> Result<(), TestError>

Assert that the recording lifecycle works end-to-end.

Starts a recording, generates activity via eval_js, waits for the event drain loop (2 seconds), stops recording, and verifies events were captured.

§Errors

Returns TestError::Assertion if recording captures zero events.

Source

pub async fn assert_health_hardened(&mut self) -> Result<(), TestError>

Assert that /health returns only {"status":"ok"}.

Verifies the endpoint doesn’t leak internal state like uptime, memory stats, or event counts.

§Errors

Returns TestError::Assertion if extra fields are present or the response shape is wrong.

Source

pub async fn smoke_test(&mut self) -> Result<SmokeReport, TestError>

Run the built-in smoke test suite with default configuration.

Exercises all core Victauri capabilities: eval, DOM, screenshot, windows, IPC integrity, accessibility, performance budgets, recording lifecycle, and health endpoint hardening.

Individual check failures are captured in the SmokeReport — the method itself only returns Err on fatal transport errors.

§Errors

Returns TestError on connection or transport failures.

Source

pub async fn smoke_test_with_config( &mut self, config: &SmokeConfig, ) -> Result<SmokeReport, TestError>

Run the built-in smoke test suite with custom thresholds.

§Errors

Returns TestError on connection or transport failures.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more