Skip to main content

PageJs

Struct PageJs 

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

JS-visible wrapper around ferridriver::Page.

Held as Arc<Page> so the same page can be shared with the MCP session while the script runs; dropping the wrapper does not close the page.

Implementations§

Source§

impl PageJs

Source

pub const js_goto: __impl_goto = __impl_goto

Source

pub const js_reload: __impl_reload = __impl_reload

Source

pub const js_go_back: __impl_go_back = __impl_go_back

Source

pub const js_go_forward: __impl_go_forward = __impl_go_forward

Source

pub const js_url: __impl_url = __impl_url

Source

pub const js_title: __impl_title = __impl_title

Source

pub const js_video: __impl_video = __impl_video

Source

pub const js_content: __impl_content = __impl_content

Source

pub const js_set_content: __impl_set_content = __impl_set_content

Source

pub const js_add_init_script: __impl_add_init_script = __impl_add_init_script

Source

pub const js_remove_init_script: __impl_remove_init_script = __impl_remove_init_script

Source

pub const js_markdown: __impl_markdown = __impl_markdown

Source

pub const js_wait_for_selector: __impl_wait_for_selector = __impl_wait_for_selector

Source

pub const js_query_selector: __impl_query_selector = __impl_query_selector

Source

pub const js_dollar: __impl_dollar = __impl_dollar

Source

pub const js_query_selector_all: __impl_query_selector_all = __impl_query_selector_all

Source

pub const js_dollar_dollar: __impl_dollar_dollar = __impl_dollar_dollar

Source

pub const js_evaluate: __impl_evaluate = __impl_evaluate

Source

pub const js_evaluate_handle: __impl_evaluate_handle = __impl_evaluate_handle

Source

pub const js_locator: __impl_locator = __impl_locator

Source

pub const js_get_by_role: __impl_get_by_role = __impl_get_by_role

Source

pub const js_get_by_text: __impl_get_by_text = __impl_get_by_text

Source

pub const js_get_by_label: __impl_get_by_label = __impl_get_by_label

Source

pub const js_get_by_placeholder: __impl_get_by_placeholder = __impl_get_by_placeholder

Source

pub const js_get_by_alt_text: __impl_get_by_alt_text = __impl_get_by_alt_text

Source

pub const js_get_by_title: __impl_get_by_title = __impl_get_by_title

Source

pub const js_get_by_test_id: __impl_get_by_test_id = __impl_get_by_test_id

Source

pub const js_click: __impl_click = __impl_click

Source

pub const js_dblclick: __impl_dblclick = __impl_dblclick

Source

pub const js_fill: __impl_fill = __impl_fill

Source

pub const js_type_: __impl_type_ = __impl_type_

Source

pub const js_press: __impl_press = __impl_press

Source

pub const js_focus: __impl_focus = __impl_focus

Source

pub const js_hover: __impl_hover = __impl_hover

Source

pub const js_dispatch_event: __impl_dispatch_event = __impl_dispatch_event

Source

pub const js_tap: __impl_tap = __impl_tap

Source

pub const js_check: __impl_check = __impl_check

Source

pub const js_uncheck: __impl_uncheck = __impl_uncheck

Source

pub const js_set_checked: __impl_set_checked = __impl_set_checked

Source

pub const js_select_option: __impl_select_option = __impl_select_option

Source

pub const js_text_content: __impl_text_content = __impl_text_content

Source

pub const js_inner_text: __impl_inner_text = __impl_inner_text

Source

pub const js_inner_html: __impl_inner_html = __impl_inner_html

Source

pub const js_input_value: __impl_input_value = __impl_input_value

Source

pub const js_get_attribute: __impl_get_attribute = __impl_get_attribute

Source

pub const js_is_visible: __impl_is_visible = __impl_is_visible

Source

pub const js_is_hidden: __impl_is_hidden = __impl_is_hidden

Source

pub const js_is_enabled: __impl_is_enabled = __impl_is_enabled

Source

pub const js_is_disabled: __impl_is_disabled = __impl_is_disabled

Source

pub const js_is_checked: __impl_is_checked = __impl_is_checked

Source

pub const js_click_at: __impl_click_at = __impl_click_at

Source

pub const js_move_mouse_smooth: __impl_move_mouse_smooth = __impl_move_mouse_smooth

Source

pub const js_drag_and_drop: __impl_drag_and_drop = __impl_drag_and_drop

Source

pub const js_set_input_files: __impl_set_input_files = __impl_set_input_files

Source

pub const js_set_viewport_size: __impl_set_viewport_size = __impl_set_viewport_size

Source

pub const js_emulate_media: __impl_emulate_media = __impl_emulate_media

Source

pub const js_screenshot: __impl_screenshot = __impl_screenshot

Source

pub const js_screenshot_element: __impl_screenshot_element = __impl_screenshot_element

Source

pub const js_pdf: __impl_pdf = __impl_pdf

Source

pub const js_close: __impl_close = __impl_close

Source

pub const js_set_default_timeout: __impl_set_default_timeout = __impl_set_default_timeout

Source

pub const js_set_default_navigation_timeout: __impl_set_default_navigation_timeout = __impl_set_default_navigation_timeout

Source

pub const js_is_closed: __impl_is_closed = __impl_is_closed

Source

pub const js_route: __impl_route = __impl_route

Source

pub const js_unroute: __impl_unroute = __impl_unroute

Source

pub const js_wait_for_request: __impl_wait_for_request = __impl_wait_for_request

Source

pub const js_wait_for_response: __impl_wait_for_response = __impl_wait_for_response

Source

pub const js_wait_for_load_state: __impl_wait_for_load_state = __impl_wait_for_load_state

Source

pub const js_wait_for_url: __impl_wait_for_url = __impl_wait_for_url

Source

pub const js_wait_for_function: __impl_wait_for_function = __impl_wait_for_function

Source

pub const js_wait_for_event: __impl_wait_for_event = __impl_wait_for_event

Source

pub const js_main_frame: __impl_main_frame = __impl_main_frame

Source

pub const js_frames: __impl_frames = __impl_frames

Source

pub const js_frame_locator: __impl_frame_locator = __impl_frame_locator

Source

pub const js_frame: __impl_frame = __impl_frame

Source

pub const js_snapshot_for_ai: __impl_snapshot_for_ai = __impl_snapshot_for_ai

Source

pub const js_aria_snapshot: __impl_aria_snapshot = __impl_aria_snapshot

Source

pub const js_expose_function: __impl_expose_function = __impl_expose_function

Source

pub const js_start_screencast: __impl_start_screencast = __impl_start_screencast

Source

pub const js_stop_screencast: __impl_stop_screencast = __impl_stop_screencast

Source§

impl PageJs

Source

pub fn new(inner: Arc<Page>) -> Self

Source

pub fn new_with_async_ctx(inner: Arc<Page>, async_ctx: AsyncContext) -> Self

Source

pub fn page_arc(&self) -> Arc<Page>

Clone of the wrapped Arc<Page> for cross-binding consumers (used by expect() to lift a PageJs into an assertion target).

Source

pub fn page(&self) -> &Arc<Page>

Source§

impl PageJs

Source

pub async fn goto<'js>( &self, ctx: Ctx<'js>, url: String, options: Opt<Value<'js>>, ) -> Result<Option<ResponseJs>>

Navigate to url. Accepts { waitUntil?, timeout?, referer? } to mirror Playwright’s page.goto(url, options?).

Source

pub async fn reload<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<Option<ResponseJs>>

Reload the current page. Accepts the same option bag as goto.

Source

pub async fn go_back<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<Option<ResponseJs>>

Navigate back in history. Accepts the same option bag as goto.

Source

pub async fn go_forward<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<Option<ResponseJs>>

Navigate forward in history. Accepts the same option bag as goto.

Source

pub fn url(&self) -> String

Current URL of the page. Playwright: page.url(): string — synchronous.

Source

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

Document title.

Source

pub fn video<'js>(&self, ctx: Ctx<'js>) -> Result<Value<'js>>

Playwright: page.video(): null | Video/tmp/playwright/packages/playwright-core/types/types.d.ts:4756. Returns a live Video handle when the owning context was created with recordVideo, or null otherwise.

Source

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

Full HTML content of the page.

Source

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

Replace the page’s HTML with html.

Source

pub async fn add_init_script<'js>( &self, ctx: Ctx<'js>, script: Value<'js>, arg: Opt<Value<'js>>, ) -> Result<String>

Register a JS snippet to run on every new document before any page script executes. Mirrors Playwright’s page.addInitScript(script, arg) — see /tmp/playwright/packages/playwright-core/src/client/page.ts:520. Accepts Function | string | { path?, content? } + optional arg exactly like the NAPI binding; all lowering runs in Rust core via ferridriver::options::evaluation_script.

Source

pub async fn remove_init_script(&self, identifier: String) -> Result<()>

Remove a previously-registered init script by identifier.

Source

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

Full page rendered as clean Markdown (headings, lists, links, tables preserved; chrome and boilerplate stripped).

Source

pub async fn wait_for_selector<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Wait for an element matching selector. Optional options object accepts { state?: 'visible'|'hidden'|'attached'|'stable', timeout?: ms }. Resolves when the condition is met; throws on timeout.

Source

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

Playwright: page.querySelector(selector): Promise<ElementHandle | null>. Mints a lifecycle crate::bindings::element_handle::ElementHandleJs pinned to the first element matching selector, or null when no element matches. Callers dispose() the handle when done to release the backend remote.

Source

pub async fn dollar(&self, selector: String) -> Result<Option<ElementHandleJs>>

Playwright $ shortcut for Self::query_selector.

Source

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

Playwright: page.querySelectorAll(selector): Promise<ElementHandle[]>.

Source

pub async fn dollar_dollar( &self, selector: String, ) -> Result<Vec<ElementHandleJs>>

Playwright $$ shortcut for Self::query_selector_all.

Source

pub async fn evaluate<'js>( &self, ctx: Ctx<'js>, page_function: Value<'js>, arg: Opt<Value<'js>>, ) -> Result<Value<'js>>

Playwright: page.evaluate(pageFunction, arg?): Promise<R>. pageFunction accepts a string or a JS function; rich return types (Date / RegExp / BigInt / URL / Error / typed arrays / NaN / ±Infinity / undefined / -0) arrive as native JS, matching Playwright’s parseResult.

Source

pub async fn evaluate_handle<'js>( &self, ctx: Ctx<'js>, page_function: Value<'js>, arg: Opt<Value<'js>>, ) -> Result<JSHandleJs>

Playwright: page.evaluateHandle(pageFunction, arg?): Promise<JSHandle>.

Source

pub fn locator<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<LocatorJs>

Playwright: page.locator(selector, options?: LocatorOptions): Locator. Thin delegator to Rust core’s Page::locator.

Source

pub fn get_by_role( &self, role: String, options: Opt<Value<'_>>, ) -> Result<LocatorJs>

Locate elements by ARIA role. Accepts { name: string | RegExp, exact, checked, disabled, expanded, level, pressed, selected, includeHidden } via the options bag.

Source

pub fn get_by_text( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>

Locate elements containing the given text. Accepts string | RegExp.

Source

pub fn get_by_label( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>

Locate form controls by associated label text.

Source

pub fn get_by_placeholder( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>

Locate inputs by placeholder text.

Source

pub fn get_by_alt_text( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>

Locate images/media by alt text.

Source

pub fn get_by_title( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>

Locate elements by title attribute text.

Source

pub fn get_by_test_id(&self, test_id: Value<'_>) -> Result<LocatorJs>

Locate elements by data-testid. Accepts string | RegExp.

Source

pub async fn click<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Click the first element matching selector. Accepts Playwright’s full PageClickOptions bag.

Source

pub async fn dblclick<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Double-click the first element matching selector. Accepts Playwright’s full PageDblClickOptions bag.

Source

pub async fn fill<'js>( &self, ctx: Ctx<'js>, selector: String, value: String, options: Opt<Value<'js>>, ) -> Result<()>

Fill value into the input matching selector. Accepts Playwright’s full PageFillOptions bag.

Source

pub async fn type_<'js>( &self, ctx: Ctx<'js>, selector: String, text: String, options: Opt<Value<'js>>, ) -> Result<()>

Type text into the input matching selector. Accepts Playwright’s full PageTypeOptions bag.

Exposed as type in JS (matches Playwright) — Rust renames to avoid the type keyword.

Source

pub async fn press<'js>( &self, ctx: Ctx<'js>, selector: String, key: String, options: Opt<Value<'js>>, ) -> Result<()>

Press key on the element matching selector. Accepts Playwright’s full PagePressOptions bag.

Source

pub async fn focus( &self, selector: String, _options: Opt<Value<'_>>, ) -> Result<()>

page.focus(selector, options?).

Source

pub async fn hover<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Hover the first element matching selector. Accepts Playwright’s full PageHoverOptions bag.

Source

pub async fn dispatch_event<'js>( &self, ctx: Ctx<'js>, selector: String, event_type: String, event_init: Opt<Value<'js>>, options: Opt<Value<'js>>, ) -> Result<()>

Dispatch a DOM event on the first element matching selector. Mirrors Playwright’s page.dispatchEvent(selector, type, eventInit?, options?).

Source

pub async fn tap<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Tap (touch) the first element matching selector. Accepts Playwright’s full PageTapOptions bag.

Source

pub async fn check<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Check a checkbox matching selector. Accepts Playwright’s full PageCheckOptions bag.

Source

pub async fn uncheck<'js>( &self, ctx: Ctx<'js>, selector: String, options: Opt<Value<'js>>, ) -> Result<()>

Uncheck a checkbox matching selector. Accepts Playwright’s full PageUncheckOptions bag.

Source

pub async fn set_checked<'js>( &self, ctx: Ctx<'js>, selector: String, checked: bool, options: Opt<Value<'js>>, ) -> Result<()>

Set the checked state of a checkbox/radio matching selector. Accepts Playwright’s full PageSetCheckedOptions bag.

Source

pub async fn select_option<'js>( &self, ctx: Ctx<'js>, selector: String, values: Value<'js>, options: Opt<Value<'js>>, ) -> Result<Vec<String>>

Select options on the <select> matching selector. Returns the values of the selected options. Accepts Playwright’s full string | string[] | { value?, label?, index? } | Array<...> union.

Source

pub async fn text_content(&self, selector: String) -> Result<Option<String>>

Text content of the first element matching selector (or null).

Source

pub async fn inner_text(&self, selector: String) -> Result<String>

innerText of the first element matching selector.

Source

pub async fn inner_html(&self, selector: String) -> Result<String>

innerHTML of the first element matching selector.

Source

pub async fn input_value(&self, selector: String) -> Result<String>

Current input value of the first element matching selector.

Source

pub async fn get_attribute( &self, selector: String, name: String, ) -> Result<Option<String>>

Get attribute name on the first element matching selector (or null if the attribute is absent).

Source

pub async fn is_visible(&self, selector: String) -> Result<bool>

Whether the first element matching selector is visible.

Source

pub async fn is_hidden(&self, selector: String) -> Result<bool>

Whether the first element matching selector is hidden.

Source

pub async fn is_enabled(&self, selector: String) -> Result<bool>

Whether the first element matching selector is enabled.

Source

pub async fn is_disabled(&self, selector: String) -> Result<bool>

Whether the first element matching selector is disabled.

Source

pub async fn is_checked(&self, selector: String) -> Result<bool>

Whether the first checkbox matching selector is checked.

Source

pub async fn click_at(&self, x: f64, y: f64) -> Result<()>

ferridriver-specific (NOT Playwright): click at viewport coordinates without a selector. Playwright equivalent: mouse.click(x, y).

Source

pub async fn move_mouse_smooth( &self, from_x: f64, from_y: f64, to_x: f64, to_y: f64, steps: u32, ) -> Result<()>

ferridriver-specific (NOT Playwright): interpolated mouse move from (fromX, fromY) to (toX, toY) in steps points. Playwright equivalent: mouse.move(x, y, { steps }).

Source

pub async fn drag_and_drop<'js>( &self, ctx: Ctx<'js>, source: String, target: String, options: Opt<Value<'js>>, ) -> Result<()>

Drag from the source selector to the target selector. Accepts Playwright’s FrameDragAndDropOptions & TimeoutOptions bag: { force?, noWaitAfter?, sourcePosition?, targetPosition?, steps?, strict?, timeout?, trial? }.

Source

pub async fn set_input_files<'js>( &self, ctx: Ctx<'js>, selector: String, files: Value<'js>, options: Opt<Value<'js>>, ) -> Result<()>

Attach files to a <input type="file"> selector. Accepts Playwright’s full string | string[] | FilePayload | FilePayload[] union plus the PageSetInputFilesOptions bag.

Source

pub async fn set_viewport_size<'js>( &self, ctx: Ctx<'js>, size: Value<'js>, ) -> Result<()>

Override the viewport size for this page. Playwright public: page.setViewportSize({ width, height }). Playwright: page.setViewportSize({ width, height }) — a single object, not two positional numbers.

Source

pub async fn emulate_media<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>

Emulate media features. Accepts Playwright’s { media?, colorScheme?, reducedMotion?, forcedColors?, contrast? } option bag — each call is a partial update layered on top of the page’s persistent emulated-media state.

Source

pub async fn screenshot<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<Vec<u8>>

Capture the page as a PNG (raw bytes — Uint8Array in JS). Pair with await artifacts.writeBytes('page.png', bytes) to save to disk. Optional options accept { fullPage?: boolean, format?: 'png'|'jpeg'|'webp', quality?: number }.

Source

pub async fn screenshot_element(&self, selector: String) -> Result<Vec<u8>>

Capture a single element as PNG bytes.

Source

pub async fn pdf<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<Vec<u8>>

Render the current page as a PDF (raw bytes). Accepts a Playwright-shape options object: { format?, landscape?, printBackground?, scale?, ... }. Pair with await artifacts.writeBytes('page.pdf', bytes) to save.

Source

pub async fn close<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>

Close the page. Accepts { runBeforeUnload?, reason? } to mirror Playwright’s page.close(options?).

Source

pub fn set_default_timeout(&self, ms: u64)

Set the default timeout for all non-navigation operations (milliseconds). Mirrors Playwright’s page.setDefaultTimeout(timeout).

Source

pub fn set_default_navigation_timeout(&self, ms: u64)

Set the default timeout for navigation-family operations (goto, reload, goBack, goForward, waitForUrl). Mirrors Playwright’s page.setDefaultNavigationTimeout(timeout).

Source

pub fn is_closed(&self) -> bool

Whether the page has been closed.

Source

pub async fn route<'js>( &self, ctx: Ctx<'js>, url: Value<'js>, handler: Function<'js>, ) -> Result<()>

Mirrors Playwright page.route(url, handler). Registers a JS callback to intercept requests matching url (string | RegExp). The callback receives a Route instance and must call exactly one of route.fulfill(), route.continue(), or route.abort() to resume the request.

Cross-task dispatch: the Rust route handler runs inside the backend’s network listener (a separate tokio task from the script’s JS context). The handler stashes the JS callback in the native RouteRegistry userdata keyed by ID at registration time; when a request matches, the handler spawns a task that async_withs back into the script’s AsyncContext, looks up the callback by ID, and invokes it with a fresh RouteJs wrapper. rquickjs’s scheduler serialises the dispatch against the script’s own await points so JS-side state stays consistent.

Source

pub async fn unroute<'js>(&self, ctx: Ctx<'js>, url: Value<'js>) -> Result<()>

page.unroute(string | RegExp | ((url: URL) => boolean)). A predicate is matched by === identity against the function passed to route, then its always-true core matcher is dropped by Arc identity so sibling predicate routes survive.

Source

pub async fn wait_for_request<'js>( &self, ctx: Ctx<'js>, url: Value<'js>, timeout_ms: Opt<f64>, ) -> Result<RequestJs>

page.waitForRequest(string | RegExp | ((r: Request) => boolean | Promise<boolean>), options?).

Source

pub async fn wait_for_response<'js>( &self, ctx: Ctx<'js>, url: Value<'js>, timeout_ms: Opt<f64>, ) -> Result<ResponseJs>

page.waitForResponse(string | RegExp | ((r: Response) => boolean | Promise<boolean>), options?).

Source

pub async fn wait_for_load_state(&self, state: Opt<String>) -> Result<()>

Mirrors Playwright page.waitForEvent(event, options?). Dispatches on the event name and returns the live class for the lifecycle events (Request / Response / WebSocket), or a snapshot object for simpler events. The overloaded return keeps the Playwright- canonical call shape — scripts write await page.waitForEvent('websocket') and receive a real WebSocket instance. Playwright: page.waitForLoadState(state?: 'load' | 'domcontentloaded' | 'networkidle', options?). Defaults to 'load'. Thin delegator to Page::wait_for_load_state.

Source

pub async fn wait_for_url<'js>( &self, ctx: Ctx<'js>, url: Value<'js>, ) -> Result<()>

Playwright: page.waitForURL(url: string | RegExp | (url:URL) => boolean, options?). Thin delegator to Page::wait_for_url (a function predicate is reduced to an always-true matcher; the function check is enforced by the core polling against the current URL).

Source

pub async fn wait_for_function<'js>( &self, ctx: Ctx<'js>, page_function: Value<'js>, _arg: Opt<Value<'js>>, options: Opt<Value<'js>>, ) -> Result<Value<'js>>

Playwright: page.waitForFunction(pageFunction: Function|string, arg?, options?: { timeout?, polling? }). Function values get String(fn) (Playwright parity) and are evaluated as IIFEs inside the page. Returns the truthy value the function resolved to.

Source

pub async fn wait_for_event<'js>( &self, ctx: Ctx<'js>, event: String, timeout_ms: Opt<f64>, ) -> Result<Value<'js>>

Source

pub fn main_frame(&self) -> FrameJs

Main frame of this page. Playwright: page.mainFrame(): Frame. Always returns a Frame — the cache is seeded inside Page::new / Page::with_context before the Page is handed out.

Source

pub fn frames(&self) -> Vec<FrameJs>

All non-detached frames on the page. Playwright: page.frames(): Frame[].

Source

pub fn frame_locator(&self, selector: String) -> FrameLocatorJs

Playwright: page.frameLocator(selector): FrameLocator. Targets an <iframe> matching the selector at the page’s main-frame scope.

Source

pub fn frame<'js>( &self, ctx: Ctx<'js>, selector: Value<'js>, ) -> Result<Option<FrameJs>>

Locate a frame by name or URL. Accepts Playwright’s union: frame(string | { name?: string; url?: string }).

Distinct null/undefined handling (like emulateMedia in task 3.24) is not required here — both absent and explicit-null mean “no filter on this field”, which matches Playwright’s optional-field semantics.

Source

pub async fn snapshot_for_ai<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<Value<'js>>

ferridriver-specific (NOT Playwright): structured AI snapshot { full: string, incremental?: string, refMap: Record<string, number> }. Playwright’s public accessibility API is ariaSnapshot (string); this richer shape feeds the MCP server’s incremental tracking.

Source

pub async fn aria_snapshot<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<String>

Playwright page.ariaSnapshot(options?): Promise<string>.

Source

pub async fn expose_function<'js>( &self, ctx: Ctx<'js>, name: String, callback: Function<'js>, ) -> Result<()>

Playwright: page.exposeFunction(name, callback). Binds window[name] to a page-side proxy that asynchronously invokes callback(args) in the script context.

The callback receives the args as a single array. The page-side call resolves to null since the script-side callback runs asynchronously (Rust core’s ExposedFn is sync + JSON-in/out; QuickJS dispatch is async-only).

Source

pub async fn start_screencast<'js>( &self, ctx: Ctx<'js>, quality: u8, max_width: u32, max_height: u32, callback: Function<'js>, ) -> Result<()>

ferridriver-specific (NOT Playwright): startScreencast(quality, maxWidth, maxHeight, callback). Callback receives { frame: Uint8Array, timestamp: number } per frame. Backed by CDP Page.startScreencast; no Playwright client equivalent.

Source

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

ferridriver-specific (NOT Playwright): stop the screencast started by startScreencast.

Source

pub fn mouse(&self) -> MouseJs

page.mouse.* namespace: click, dblclick, down, up, wheel. Exposed as a JS property, matching Playwright.

Source

pub fn keyboard(&self) -> KeyboardJs

page.keyboard.* namespace: down, up, press (no selector; acts on the currently focused element). Exposed as a JS property.

Source

pub fn touchscreen(&self) -> TouchscreenJs

Playwright: page.touchscreen: Touchscreen.

Trait Implementations§

Source§

impl<'js> FromJs<'js> for PageJs
where for<'a> CloneWrapper<'a, Self>: CloneTrait<Self>,

Source§

fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self>

Source§

impl<'js> IntoJs<'js> for PageJs

Source§

fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>>

Source§

impl<'js> JsClass<'js> for PageJs

Source§

const NAME: &'static str = "Page"

The name the constructor has in JavaScript
Source§

type Mutable = Writable

Can the type be mutated while a JavaScript value. Read more
Source§

fn prototype(ctx: &Ctx<'js>) -> Result<Option<Object<'js>>>

Returns the class prototype,
Source§

fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>

Returns a predefined constructor for this specific class type if there is one.
Source§

const CALLABLE: bool = false

Is this class a function.
Source§

fn call<'a>( this: &JsCell<'js, Self>, params: Params<'a, 'js>, ) -> Result<Value<'js>, Error>

The function which will be called if Self::CALLABLE is true and an an object with this class is called as if it is a function.
Source§

impl<'js> JsLifetime<'js> for PageJs

Source§

type Changed<'to> = PageJs

The target which has the same type as a Self but with another lifetime 't
Source§

impl MethodImplementor<PageJs> for MethodImpl<PageJs>

Source§

fn implement(&self, _proto: &Object<'_>) -> Result<()>

Source§

impl<'js> Trace<'js> for PageJs

Source§

fn trace<'a>(&self, _tracer: Tracer<'a, 'js>)

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<'js, T> AsProperty<'js, T> for T
where T: IntoJs<'js>,

Source§

fn config( self, ctx: &Ctx<'js>, ) -> Result<(i32, Value<'js>, Value<'js>, Value<'js>), Error>

Property configuration 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> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
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<'js, T> IntoArg<'js> for T
where T: IntoJs<'js>,

Source§

fn num_args(&self) -> usize

The number of arguments this value produces.
Source§

fn into_arg(self, args: &mut Args<'js>) -> Result<(), Error>

Convert the value into an argument.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

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

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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
Source§

impl<T> ParallelSend for T
where T: Send,