Skip to main content

Page

Struct Page 

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

A page (tab) in a browser.

Implementations§

Source§

impl Page

Source

pub fn browser(&self) -> Browser

Source

pub fn target_id(&self) -> &str

Source

pub fn is_closed(&self) -> bool

Source

pub fn set_default_timeout(&self, ms: u64)

Set the default timeout (ms) for all actions on this page, mirroring Playwright’s page.setDefaultTimeout. The value is stored on the page ([PageInner::default_timeout_ms]) and propagated to the underlying CDP session’s command timeout.

Source

pub async fn goto( &self, url: &str, opts: Option<GotoOptions>, ) -> Result<Option<Response>>

Navigate to url.

Source

pub async fn reload( &self, opts: Option<GotoOptions>, ) -> Result<Option<Response>>

Reload the page.

Source

pub async fn wait_for_load_state(&self, state: Option<WaitUntil>) -> Result<()>

Wait for a given document lifecycle state.

Source

pub async fn go_back( &self, opts: Option<GotoOptions>, ) -> Result<Option<Response>>

Navigate one entry back in history (best-effort; returns no response).

Source

pub async fn go_forward( &self, opts: Option<GotoOptions>, ) -> Result<Option<Response>>

Navigate one entry forward in history (best-effort; returns no response).

Source

pub async fn wait_for_url( &self, url: &str, opts: Option<GotoOptions>, ) -> Result<()>

Wait until the page URL matches url (exact, or * glob), then optionally wait for a lifecycle state.

Source

pub fn set_default_navigation_timeout(&self, ms: u64)

Set the default navigation timeout (ms), separate from action timeout.

Source

pub async fn emulate_media( &self, opts: Option<EmulateMediaOptions>, ) -> Result<()>

Emulate CSS media (media / color-scheme / reduced-motion).

Source

pub async fn set_offline(&self, offline: bool) -> Result<()>

Toggle network offline emulation.

Source

pub async fn drag_and_drop( &self, source: &str, target: &str, options: Option<DragToOptions>, ) -> Result<()>

Drag the element matched by source onto the element matched by target.

Source

pub async fn url(&self) -> Result<String>

Source

pub async fn title(&self) -> Result<String>

Source

pub async fn content(&self) -> Result<String>

Source

pub async fn set_content(&self, html: &str) -> Result<()>

Source

pub async fn evaluate<R: DeserializeOwned>(&self, expression: &str) -> Result<R>

Evaluate a JS expression in the main world, returning a typed result.

expression is wrapped as (arg) => { return (<expression>); }.

Source

pub async fn evaluate_handle(&self, expression: &str) -> Result<JSHandle>

Evaluate a JS expression in the main world, returning a JSHandle to the result (returned by reference, not by value). Mirrors Playwright’s page.evaluateHandle.

Like evaluate, expression is wrapped as (arg) => { return (<expression>); } and run against the page’s main world. The returned Runtime.RemoteObjectId is captured and wrapped in a JSHandle. Returns an error if the evaluation yields null/ undefined (no remote object to reference).

Source

pub async fn evaluate_with_arg<R: DeserializeOwned, T: Serialize>( &self, expression: &str, arg: &T, ) -> Result<R>

Evaluate a JS expression with a JSON-serializable argument.

Source

pub async fn wait_for_function<R: DeserializeOwned>( &self, expression: &str, arg: Option<Value>, options: Option<WaitForFunctionOptions>, ) -> Result<R>

Poll expression until it evaluates to a truthy value, then return the deserialized result. Mirrors Playwright’s page.waitForFunction.

expression is wrapped as (arg) => { return (<expression>); } (the same form as Page::evaluate). A value is considered truthy unless it is null, false, 0, or "". On timeout (default 30s) this returns Error::Timeout. Polls every polling_interval ms (default 100).

Source

pub async fn eval_on_selector<R: DeserializeOwned>( &self, selector: &str, expression: &str, ) -> Result<R>

Evaluate expression against the first element matching selector.

Source

pub async fn eval_on_selector_all<R: DeserializeOwned>( &self, selector: &str, expression: &str, ) -> Result<Vec<R>>

Evaluate expression against all elements matching selector.

Source

pub async fn set_viewport_size(&self, viewport: Viewport) -> Result<()>

Source

pub async fn screenshot( &self, opts: Option<ScreenshotOptions>, ) -> Result<Vec<u8>>

Source

pub async fn add_script_tag( &self, content: Option<&str>, url: Option<&str>, ) -> Result<()>

Inject a <script> tag into the page (inline content and/or url).

Source

pub async fn add_style_tag(&self, content: &str) -> Result<()>

Inject a <style> tag into the page.

Source

pub async fn set_cache_disabled(&self, disabled: bool) -> Result<()>

Enable/disable the HTTP cache for this page.

Source

pub async fn bring_to_front(&self) -> Result<()>

Bring the page to the front (focus).

Source

pub async fn set_geolocation( &self, geolocation: Option<(f64, f64)>, ) -> Result<()>

Override geolocation (latitude, longitude) (or clear with None). Requires a granted geolocation permission.

Source

pub fn request(&self) -> APIRequestContext

Return a standalone HTTP client (APIRequestContext) tied to this page. The client shares no state with the browser tab — it is a direct HTTP client useful for API testing.

Note: the page does not retain its extra_http_headers in Rust (they are applied directly to CDP), so the returned context starts with an empty default header set. Use [BrowserContext::request] to seed defaults from the context.

Source

pub async fn set_extra_http_headers(&self, headers: Headers) -> Result<()>

Source

pub async fn add_init_script(&self, script: &str) -> Result<()>

Source

pub async fn expose_function<F, Fut>( &self, name: &str, callback: F, ) -> Result<()>
where F: Fn(Vec<Value>) -> Fut + Send + Sync + 'static, Fut: Future<Output = Value> + Send + 'static,

Expose a Rust function to the page as window[name].

After this returns, page JS can call await window.<name>(...args) and receive the Rust callback’s return value (serialized as JSON). Mirrors Playwright’s page.exposeFunction.

The callback receives the JS arguments as a Vec<serde_json::Value> and returns a serde_json::Value. If the callback panics or its result fails to serialize, the JS promise resolves with { "__error": "<message>" } rather than rejecting.

§Mechanism

A CDP binding is registered under the internal name __pwcdpInvoke_<name> via Runtime.addBinding. A JS wrapper turns window[name] into a Promise-returning function that forwards { id, args } to that binding (as a JSON string). A per-registration listener handles Runtime.bindingCalled, invokes the callback on its own task, and resolves the Promise by evaluating against the pending-callback map.

The wrapper is installed for future documents via Page.addScriptToEvaluateOnNewDocument and once in the current context. Bindings are per-execution-context and reset on navigation: the wrapper is re-installed on every new document, but Runtime.addBinding is only re-asserted lazily if needed (it persists across same-origin navigations on a live page session; call expose_function again after a cross-origin navigation if the binding goes missing).

Source

pub fn locator(&self, selector: impl Into<String>) -> Locator

Source

pub fn frame_locator(&self, selector: impl Into<String>) -> FrameLocator

Return a FrameLocator scoped to the same-origin <iframe> matched by selector. Element queries on the returned locator resolve inside the iframe’s contentDocument.

Same-origin only. Cross-origin iframes cannot be reached from the page’s main world; their contentDocument reads as null, and queries against them will report zero matches. srcdoc iframes and same-origin src iframes are supported.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_by_role( &self, role: AriaRole, opts: Option<GetByRoleOptions>, ) -> Locator

Source

pub async fn query_selector( &self, selector: &str, ) -> Result<Option<ElementHandle>>

The first element matching selector, if any.

Source

pub async fn query_selector_all( &self, selector: &str, ) -> Result<Vec<ElementHandle>>

All elements matching selector.

Source

pub fn keyboard(&self) -> Keyboard

Source

pub fn mouse(&self) -> Mouse

Source

pub fn touchscreen(&self) -> Touchscreen

Source

pub fn video(&self) -> Video

The page video capture handle, mirroring Playwright’s page.video().

If a video output path was configured for the page, it is pre-recorded on the handle (via Video::with_path); otherwise the handle starts with no path and one can be supplied at Video::start.

Source

pub fn accessibility(&self) -> Accessibility

The page accessibility-tree handle, mirroring Playwright’s page.accessibility().

Source

pub fn coverage(&self) -> Coverage

The page code-coverage handle, mirroring Playwright’s page.coverage().

Source

pub fn clock(&self) -> Clock

The page fake-timer handle, mirroring Playwright’s page.clock().

Source

pub async fn web_storage(&self) -> WebStorage

The page’s localStorage for its current security origin, mirroring Playwright’s page.evaluate(() => localStorage)-backed access but speaking CDP’s DOMStorage domain directly.

The origin is derived from the current location.href (scheme://host with port). Returns a best-effort handle; if the URL has no parseable origin (e.g. about:blank), the empty string is used as the origin.

Source

pub async fn local_storage(&self) -> WebStorage

The page’s localStorage for its current security origin.

Source

pub async fn session_storage(&self) -> WebStorage

The page’s sessionStorage for its current security origin.

Source

pub fn main_frame(&self) -> Frame

Source

pub async fn frames(&self) -> Result<Vec<Frame>>

All frames in the page (refreshed from the browser).

Source

pub fn on_console<F, Fut>(&self, handler: F)
where F: Fn(ConsoleMessage) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Source

pub fn on_load<F, Fut>(&self, handler: F)
where F: Fn(()) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when the page fires its load event (Page.loadEventFired), mirroring Playwright’s page.on('load').

Source

pub fn on_crash<F, Fut>(&self, handler: F)
where F: Fn(()) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when the page crashes (Inspector.targetCrashed), mirroring Playwright’s page.on('crash').

Source

pub fn on_frameattached<F, Fut>(&self, handler: F)
where F: Fn(FrameEvent) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a frame is attached to the page (Page.frameAttached), mirroring Playwright’s page.on('frameattached').

Source

pub fn on_framedetached<F, Fut>(&self, handler: F)
where F: Fn(FrameEvent) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a frame is detached from the page (Page.frameDetached), mirroring Playwright’s page.on('framedetached').

Source

pub fn on_framenavigated<F, Fut>(&self, handler: F)
where F: Fn(FrameEvent) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a frame is navigated to a new URL (Page.frameNavigated), mirroring Playwright’s page.on('framenavigated').

Source

pub fn on_dialog<F, Fut>(&self, handler: F)
where F: Fn(Dialog) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Source

pub fn on_request<F, Fut>(&self, handler: F)
where F: Fn(Request) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked for each network request sent.

Source

pub async fn expect_request( &self, url_predicate: &str, timeout: Option<Duration>, ) -> Result<Request>

Wait for a network request whose URL contains url_predicate, returning it. Times out after timeout (default 30s) with Error::Timeout.

The matcher is a plain substring test against the request URL (str::contains), not a regex or glob — keep predicates literal.

A one-shot handler is registered with on_request; it sends the first matching event over a tokio::sync::oneshot channel and then drains its sender to None, so subsequent events are no-ops. The handler is not removed from the handler list after it fires — it simply has nothing to send — so it is idempotent and harmless to leave in place (one extra closure in a Vec, no side effects).

Typical use races the wait against the action that triggers the request:

let button = page.locator("button#submit");
let (req, _) = tokio::join!(
    page.expect_request("/api/login", Some(Duration::from_secs(5))),
    button.click(None),
);
let req = req.unwrap();
assert!(req.url().contains("/api/login"));
Source

pub fn on_response<F, Fut>(&self, handler: F)
where F: Fn(Response) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked for each network response received.

Source

pub async fn expect_response( &self, url_predicate: &str, timeout: Option<Duration>, ) -> Result<Response>

Wait for a network response whose URL contains url_predicate, returning it. Times out after timeout (default 30s) with Error::Timeout.

The matcher is a plain substring test against the response URL (str::contains), not a regex or glob — keep predicates literal.

A one-shot handler is registered with on_response; it sends the first matching event over a tokio::sync::oneshot channel and then drains its sender to None, so subsequent events are no-ops. The handler is not removed from the handler list after it fires — it simply has nothing to send — so it is idempotent and harmless to leave in place (one extra closure in a Vec, no side effects).

Typical use races the wait against the navigation that triggers it:

let (resp, _) = tokio::join!(
    page.expect_response("127.0.0.1", Some(Duration::from_secs(5))),
    page.goto(url, None),
);
assert_eq!(resp.unwrap().status(), 200);
Source

pub async fn expect_event( &self, event_name: &str, timeout: Option<Duration>, ) -> Result<Value>

Wait for the next CDP event whose method equals event_name, returning its params. Times out after timeout (default 30s) with Error::Timeout.

Subscribes to the page session’s event stream, so it only sees events emitted after this call — race it against the triggering action with tokio::join!.

Example: wait for the page’s load event during navigation.

let (params, _) = tokio::join!(
    page.expect_event("Page.loadEventFired", Some(Duration::from_secs(5))),
    page.goto(url, None),
);
let _params = params.unwrap();
Source

pub fn on_requestfailed<F, Fut>(&self, handler: F)
where F: Fn(Request) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a network request fails.

Source

pub fn on_pageerror<F, Fut>(&self, handler: F)
where F: Fn(String) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when an uncaught page error occurs.

Source

pub fn on_websocket<F, Fut>(&self, handler: F)
where F: Fn(WebSocket) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked for each new WebSocket connection, mirroring Playwright’s page.on('websocket').

Capture is always on: the page’s WebSocketRegistry subscribes to the session in Page::attach (before Network.enable), so every Network.webSocket* event is already being accumulated into a WebSocket handle. This method registers against the registry’s created-connection bus and invokes handler for each newly-created connection. Connections created before this call are not replayed — register the handler early (before the page opens the socket) to observe every one.

Source

pub fn on_requestfinished<F, Fut>(&self, handler: F)
where F: Fn(Request) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a network request finishes loading.

Source

pub fn on_close<F, Fut>(&self, handler: F)
where F: Fn() -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when the page closes.

Source

pub fn on_download<F, Fut>(&self, handler: F)
where F: Fn(Download) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked for each file download (Page.downloadWillBegin).

On first registration, downloads are routed to a per-page temp directory via Page.setDownloadBehavior allow. Progress events update the download’s shared state so Download::path / Download::save_as can await completion.

Source

pub async fn expect_download( &self, url_predicate: &str, timeout: Option<Duration>, ) -> Result<Download>

Wait for a download whose URL contains url_predicate, returning it. Times out after timeout (default 30s) with Error::Timeout.

The matcher is a plain substring test against the download URL (str::contains), not a regex or glob — keep predicates literal.

A one-shot handler is registered with on_download; it sends the first matching event over a tokio::sync::oneshot channel and then drains its sender to None, so subsequent events are no-ops. The handler is not removed from the handler list after it fires — it simply has nothing to send — so it is idempotent and harmless to leave in place (one extra closure in a Vec, no side effects).

Note that the first on_download registration on a page lazily wires up Page.setDownloadBehavior, so this call implicitly opts the page into download routing to a temp dir.

Typical use races the wait against the click that triggers the download:

let link = page.locator("a#download");
let (dl, _) = tokio::join!(
    page.expect_download("/report.pdf", Some(Duration::from_secs(5))),
    link.click(None),
);
let dl = dl.unwrap();
assert!(dl.url().contains("/report.pdf"));
Source

pub async fn expect_console_message( &self, text_predicate: &str, timeout: Option<Duration>, ) -> Result<ConsoleMessage>

Wait for a console message whose text contains text_predicate, returning it. Times out after timeout (default 30s) with Error::Timeout.

The matcher is a plain substring test against the console message text (ConsoleMessage::text, str::contains), not a regex or glob — keep predicates literal.

A one-shot handler is registered with on_console; it sends the first matching event over a tokio::sync::oneshot channel and then drains its sender to None, so subsequent events are no-ops. The handler task keeps running for the life of the page (one extra spawned task, no side effects), mirroring the oneshot pattern used by the other expect_* helpers.

Typical use races the wait against the script that logs the message:

let (msg, _) = tokio::join!(
    page.expect_console_message("hello", Some(Duration::from_secs(5))),
    page.evaluate::<()>("console.log('hello world')"),
);
assert!(msg.unwrap().text().contains("hello"));
Source

pub async fn expect_popup(&self, timeout: Option<Duration>) -> Result<Page>

Wait for a popup (window.open) opened by this page, returning it as a new Page. Times out after timeout (default 30s) with Error::Timeout.

§Implementation (polling-based)

A popup (window.open) is a new top-level page target rather than a child of this page’s target, so child-target auto-attach does not surface it (and Target.targetCreated does not fire for popups on stock Chrome in this setup, while Target.getTargets omits openerId). This helper therefore registers a one-shot handler with on_popup, which polls Target.getTargets and treats the first new type == "page" target in this page’s browser context as the popup. See on_popup for the full limitations.

The popup Page is built with an empty init-script set and this page’s default timeout; per-context defaults (extra headers, user agent, viewport) are not re-applied, since Page does not expose them as raw values. This is sufficient for typical popup-driving flows (interact with the popup, then close it).

Typical use races the wait against the script that opens the popup:

let (popup, _) = tokio::join!(
    page.expect_popup(Some(Duration::from_secs(5))),
    page.evaluate::<()>("window.open('about:blank')"),
);
let _popup = popup.unwrap();
Source

pub async fn on_popup<F, Fut>(&self, handler: F)
where F: Fn(Page) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when this page opens a popup (window.open), mirroring Playwright’s page.on('popup').

§Implementation (polling, not event-driven)

A popup is a brand-new top-level page target, not a child of this page’s target, so this page session’s Target.setAutoAttach does not surface it (and, empirically, Target.setDiscoverTargets / Target.targetCreated do not fire for window.open popups on stock Chrome in this setup). Target.getTargets also omits openerId, so strict opener attribution is not available.

Instead, on first registration a background task polls Target.getTargets on a short interval. Any type == "page" target that shares this page’s browserContextId, is not this page itself, and has not already been delivered is treated as the popup: the task attaches to it (Target.attachToTarget { flatten }), builds a full Page via Page::attach, and hands it to every registered handler. A delivered set (rather than a registration-time baseline) is used because a baseline diff races with the trigger under tokio::join! — the popup can appear before the snapshot completes.

Limitations (documented honestly): attribution is “any page target in this browser context that isn’t this page,” not opener-precise, so it can misattribute if another page already exists or is opened concurrently in the same context. Each distinct popup target fires the handlers once.

The popup Page is built with an empty init-scripts set and this page’s default timeout; context-level defaults (extra headers, user agent, viewport) are not re-applied (see expect_popup).

Source

pub async fn on_filechooser<F, Fut>(&self, handler: F)
where F: Fn(FileChooser) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a file-chooser dialog opens (Page.fileChooserOpened), mirroring Playwright’s page.on('filechooser').

On first registration, chooser interception is enabled once via Page.setInterceptFileChooserDialog { enabled: true } (must be in place before the action that opens the chooser). The handler may inspect the FileChooser and call FileChooser::set_files to accept it.

Source

pub async fn on_worker<F, Fut>(&self, handler: F)
where F: Fn(Worker) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Register a handler invoked when a web/service/shared worker is created, mirroring Playwright’s page.on('worker').

On first registration, flattened auto-attach is enabled on the page session (Target.setAutoAttach { flatten: true }) so workers show up as child sessions on the same connection. Each child target of type worker/service_worker/shared_worker surfaces via Target.attachedToTarget and is wrapped in a Worker.

Subscribe before enabling so the first attachedToTarget is never missed.

Source

pub async fn close(&self) -> Result<()>

Source

pub async fn route<F, Fut>(&self, pattern: &str, handler: F) -> Result<()>
where F: Fn(Route) -> Fut + Send + Sync + 'static, Fut: Future<Output = ()> + Send + 'static,

Intercept requests matching pattern (a URL glob, *-wildcarded) and route them to handler. The handler must continue/fulfill/abort the Route (an unhandled route stalls the request).

Source

pub async fn unroute(&self, pattern: &str) -> Result<()>

Remove the first route registered with exactly pattern.

Source

pub async fn unroute_all(&self) -> Result<()>

Remove all routes.

Source

pub async fn pdf(&self, opts: Option<PdfOptions>) -> Result<Vec<u8>>

Source

pub async fn aria_snapshot(&self) -> Result<String>

Capture an aria-snapshot (Playwright’s YAML-ish accessibility-tree format) of the whole page.

Fetches the full accessibility tree via Accessibility.getFullAXTree and serializes it with [crate::aria_snapshot]. The Accessibility domain is enabled best-effort first (some Chrome builds require it).

Trait Implementations§

Source§

impl Clone for Page

Source§

fn clone(&self) -> Page

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Page

§

impl !UnwindSafe for Page

§

impl Freeze for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl UnsafeUnpin for Page

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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