pub struct LocatorJs { /* private fields */ }Implementations§
Source§impl LocatorJs
impl LocatorJs
pub const js_locator: __impl_locator = __impl_locator
pub const js_filter: __impl_filter = __impl_filter
pub const js_and: __impl_and = __impl_and
pub const js_or: __impl_or = __impl_or
pub const js_element_handle: __impl_element_handle = __impl_element_handle
pub const js_element_handles: __impl_element_handles = __impl_element_handles
pub const js_get_by_role: __impl_get_by_role = __impl_get_by_role
pub const js_get_by_text: __impl_get_by_text = __impl_get_by_text
pub const js_get_by_label: __impl_get_by_label = __impl_get_by_label
pub const js_get_by_placeholder: __impl_get_by_placeholder = __impl_get_by_placeholder
pub const js_get_by_alt_text: __impl_get_by_alt_text = __impl_get_by_alt_text
pub const js_get_by_title: __impl_get_by_title = __impl_get_by_title
pub const js_get_by_test_id: __impl_get_by_test_id = __impl_get_by_test_id
pub const js_content_frame: __impl_content_frame = __impl_content_frame
pub const js_frame_locator: __impl_frame_locator = __impl_frame_locator
pub const js_page: __impl_page = __impl_page
pub const js_first: __impl_first = __impl_first
pub const js_last: __impl_last = __impl_last
pub const js_nth: __impl_nth = __impl_nth
pub const js_click: __impl_click = __impl_click
pub const js_dblclick: __impl_dblclick = __impl_dblclick
pub const js_fill: __impl_fill = __impl_fill
pub const js_clear: __impl_clear = __impl_clear
pub const js_type_: __impl_type_ = __impl_type_
pub const js_press_sequentially: __impl_press_sequentially = __impl_press_sequentially
pub const js_press: __impl_press = __impl_press
pub const js_hover: __impl_hover = __impl_hover
pub const js_tap: __impl_tap = __impl_tap
pub const js_focus: __impl_focus = __impl_focus
pub const js_blur: __impl_blur = __impl_blur
pub const js_check: __impl_check = __impl_check
pub const js_uncheck: __impl_uncheck = __impl_uncheck
pub const js_set_checked: __impl_set_checked = __impl_set_checked
pub const js_select_option: __impl_select_option = __impl_select_option
pub const js_set_input_files: __impl_set_input_files = __impl_set_input_files
pub const js_scroll_into_view_if_needed: __impl_scroll_into_view_if_needed = __impl_scroll_into_view_if_needed
pub const js_wait_for: __impl_wait_for = __impl_wait_for
pub const js_dispatch_event: __impl_dispatch_event = __impl_dispatch_event
pub const js_count: __impl_count = __impl_count
pub const js_screenshot: __impl_screenshot = __impl_screenshot
pub const js_text_content: __impl_text_content = __impl_text_content
pub const js_inner_text: __impl_inner_text = __impl_inner_text
pub const js_inner_html: __impl_inner_html = __impl_inner_html
pub const js_input_value: __impl_input_value = __impl_input_value
pub const js_aria_snapshot: __impl_aria_snapshot = __impl_aria_snapshot
pub const js_get_attribute: __impl_get_attribute = __impl_get_attribute
pub const js_is_visible: __impl_is_visible = __impl_is_visible
pub const js_is_enabled: __impl_is_enabled = __impl_is_enabled
pub const js_is_disabled: __impl_is_disabled = __impl_is_disabled
pub const js_is_checked: __impl_is_checked = __impl_is_checked
pub const js_is_editable: __impl_is_editable = __impl_is_editable
pub const js_is_attached: __impl_is_attached = __impl_is_attached
pub const js_drag_to: __impl_drag_to = __impl_drag_to
pub const js_all_text_contents: __impl_all_text_contents = __impl_all_text_contents
pub const js_all_inner_texts: __impl_all_inner_texts = __impl_all_inner_texts
pub const js_evaluate: __impl_evaluate = __impl_evaluate
pub const js_evaluate_handle: __impl_evaluate_handle = __impl_evaluate_handle
pub const js_evaluate_all: __impl_evaluate_all = __impl_evaluate_all
Source§impl LocatorJs
impl LocatorJs
Sourcepub fn locator<'js>(
&self,
ctx: Ctx<'js>,
selector_or_locator: Value<'js>,
options: Opt<Value<'js>>,
) -> Result<LocatorJs>
pub fn locator<'js>( &self, ctx: Ctx<'js>, selector_or_locator: Value<'js>, options: Opt<Value<'js>>, ) -> Result<LocatorJs>
Narrow this locator’s scope.
Full Playwright signature:
locator(selectorOrLocator: string | Locator, options?: { has?, hasNot?, hasText?, hasNotText? }): Locator.
The visible flag is the one LocatorOptions field NOT accepted
here — Playwright restricts it to filter() and the Locator
constructor (see
/tmp/playwright/packages/playwright-core/src/client/locator.ts:164).
Sourcepub fn filter<'js>(
&self,
ctx: Ctx<'js>,
options: Opt<Value<'js>>,
) -> Result<LocatorJs>
pub fn filter<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<LocatorJs>
Playwright: locator.filter(options?: LocatorOptions): Locator
(/tmp/playwright/packages/playwright-core/src/client/locator.ts:204).
Thin delegator to Rust core’s Locator::filter.
Sourcepub fn and<'js>(&self, ctx: Ctx<'js>, other: Value<'js>) -> Result<LocatorJs>
pub fn and<'js>(&self, ctx: Ctx<'js>, other: Value<'js>) -> Result<LocatorJs>
Playwright: locator.and(locator: Locator): Locator
(/tmp/playwright/packages/playwright-core/src/client/locator.ts —
matches elements satisfying BOTH this and other on the same
element). Thin delegator to core’s Locator::and.
Sourcepub fn or<'js>(&self, ctx: Ctx<'js>, other: Value<'js>) -> Result<LocatorJs>
pub fn or<'js>(&self, ctx: Ctx<'js>, other: Value<'js>) -> Result<LocatorJs>
Playwright: locator.or(locator: Locator): Locator — matches
elements from EITHER selector. Thin delegator to Locator::or.
Sourcepub async fn element_handle(&self) -> Result<ElementHandleJs>
pub async fn element_handle(&self) -> Result<ElementHandleJs>
Playwright: locator.elementHandle(): Promise<ElementHandle>.
Resolves and returns a pinned ElementHandle.
Sourcepub async fn element_handles(&self) -> Result<Vec<ElementHandleJs>>
pub async fn element_handles(&self) -> Result<Vec<ElementHandleJs>>
Playwright: locator.elementHandles(): Promise<ElementHandle[]>.
pub fn get_by_role( &self, role: String, options: Opt<Value<'_>>, ) -> Result<LocatorJs>
pub fn get_by_text( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>
pub fn get_by_label( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>
pub fn get_by_placeholder( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>
pub fn get_by_alt_text( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>
pub fn get_by_title( &self, text: Value<'_>, options: Opt<Value<'_>>, ) -> Result<LocatorJs>
pub fn get_by_test_id(&self, test_id: Value<'_>) -> Result<LocatorJs>
Sourcepub fn content_frame(&self) -> FrameLocatorJs
pub fn content_frame(&self) -> FrameLocatorJs
Playwright: locator.contentFrame(): FrameLocator.
Sourcepub fn frame_locator(&self, selector: String) -> FrameLocatorJs
pub fn frame_locator(&self, selector: String) -> FrameLocatorJs
Playwright: locator.frameLocator(selector): FrameLocator.
Sourcepub fn page(&self, ctx: Ctx<'_>) -> PageJs
pub fn page(&self, ctx: Ctx<'_>) -> PageJs
Playwright: locator.page(): Page. Carries the session’s
AsyncContext (via userdata) so page.route /
page.exposeFunction work on the returned handle.
pub fn first(&self) -> LocatorJs
pub fn last(&self) -> LocatorJs
pub fn nth(&self, index: i32) -> LocatorJs
pub async fn click<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn dblclick<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn fill<'js>( &self, ctx: Ctx<'js>, value: String, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn clear(&self) -> Result<()>
pub async fn type_<'js>( &self, ctx: Ctx<'js>, text: String, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn press_sequentially<'js>( &self, ctx: Ctx<'js>, text: String, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn press<'js>( &self, ctx: Ctx<'js>, key: String, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn hover<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn tap<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn focus(&self) -> Result<()>
pub async fn blur(&self) -> Result<()>
pub async fn check<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn uncheck<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn set_checked<'js>( &self, ctx: Ctx<'js>, checked: bool, options: Opt<Value<'js>>, ) -> Result<()>
pub async fn select_option<'js>( &self, ctx: Ctx<'js>, values: Value<'js>, options: Opt<Value<'js>>, ) -> Result<Vec<String>>
Sourcepub async fn set_input_files<'js>(
&self,
ctx: Ctx<'js>,
files: Value<'js>,
options: Opt<Value<'js>>,
) -> Result<()>
pub async fn set_input_files<'js>( &self, ctx: Ctx<'js>, files: Value<'js>, options: Opt<Value<'js>>, ) -> Result<()>
Attach files to a <input type=file> this locator matches.
Accepts Playwright’s full
string | string[] | FilePayload | FilePayload[] union.
pub async fn scroll_into_view_if_needed(&self) -> Result<()>
Sourcepub async fn wait_for<'js>(
&self,
ctx: Ctx<'js>,
options: Opt<Value<'js>>,
) -> Result<()>
pub async fn wait_for<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<()>
Playwright: locator.waitFor(options?: { state?: 'attached' | 'detached' | 'visible' | 'hidden', timeout?: number }). Thin
delegator to core Locator::wait_for(WaitOptions).
Sourcepub async fn dispatch_event<'js>(
&self,
ctx: Ctx<'js>,
event_type: String,
event_init: Opt<Value<'js>>,
options: Opt<Value<'js>>,
) -> Result<()>
pub async fn dispatch_event<'js>( &self, ctx: Ctx<'js>, event_type: String, event_init: Opt<Value<'js>>, options: Opt<Value<'js>>, ) -> Result<()>
Dispatch a DOM event on the element. Mirrors Playwright’s
locator.dispatchEvent(type, eventInit?, options?).
pub async fn count(&self) -> Result<i32>
Sourcepub async fn screenshot(&self) -> Result<Vec<u8>>
pub async fn screenshot(&self) -> Result<Vec<u8>>
Playwright: locator.screenshot(options?): Promise<Buffer>.
Thin delegator to core Locator::screenshot (PNG bytes).
pub async fn text_content(&self) -> Result<Option<String>>
pub async fn inner_text(&self) -> Result<String>
pub async fn inner_html(&self) -> Result<String>
pub async fn input_value(&self) -> Result<String>
Sourcepub async fn aria_snapshot<'js>(
&self,
ctx: Ctx<'js>,
options: Opt<Value<'js>>,
) -> Result<String>
pub async fn aria_snapshot<'js>( &self, ctx: Ctx<'js>, options: Opt<Value<'js>>, ) -> Result<String>
Playwright: locator.ariaSnapshot(options?: TimeoutOptions & { mode?: 'ai' | 'default', depth?: number }): Promise<string>.
pub async fn get_attribute(&self, name: String) -> Result<Option<String>>
pub async fn is_visible(&self) -> Result<bool>
pub async fn is_enabled(&self) -> Result<bool>
pub async fn is_disabled(&self) -> Result<bool>
pub async fn is_checked(&self) -> Result<bool>
pub async fn is_editable(&self) -> Result<bool>
pub async fn is_attached(&self) -> Result<bool>
Sourcepub async fn drag_to<'js>(
&self,
ctx: Ctx<'js>,
target: Class<'js, LocatorJs>,
options: Opt<Value<'js>>,
) -> Result<()>
pub async fn drag_to<'js>( &self, ctx: Ctx<'js>, target: Class<'js, LocatorJs>, options: Opt<Value<'js>>, ) -> Result<()>
Drag this element to target. Mirrors Playwright’s
locator.dragTo(target, options?) per
/tmp/playwright/packages/playwright-core/types/types.d.ts:13293.
Accepts { force?, noWaitAfter?, sourcePosition?, targetPosition?, steps?, timeout?, trial? }. strict is omitted here (present on
Playwright’s page.dragAndDrop options but not locator.dragTo,
because the locator already carries its own strict flag).
pub async fn all_text_contents(&self) -> Result<Vec<String>>
pub async fn all_inner_texts(&self) -> Result<Vec<String>>
Sourcepub async fn evaluate<'js>(
&self,
ctx: Ctx<'js>,
page_function: Value<'js>,
arg: Opt<Value<'js>>,
) -> Result<Value<'js>>
pub async fn evaluate<'js>( &self, ctx: Ctx<'js>, page_function: Value<'js>, arg: Opt<Value<'js>>, ) -> Result<Value<'js>>
Playwright: locator.evaluate(pageFunction, arg?, options?): Promise<R>.
Sourcepub async fn evaluate_handle<'js>(
&self,
ctx: Ctx<'js>,
page_function: Value<'js>,
arg: Opt<Value<'js>>,
) -> Result<JSHandleJs>
pub async fn evaluate_handle<'js>( &self, ctx: Ctx<'js>, page_function: Value<'js>, arg: Opt<Value<'js>>, ) -> Result<JSHandleJs>
Playwright: locator.evaluateHandle(pageFunction, arg?, options?): Promise<JSHandle>.
Trait Implementations§
Source§impl<'js> JsClass<'js> for LocatorJs
impl<'js> JsClass<'js> for LocatorJs
Source§fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Source§impl<'js> JsLifetime<'js> for LocatorJs
impl<'js> JsLifetime<'js> for LocatorJs
Auto Trait Implementations§
impl Freeze for LocatorJs
impl !RefUnwindSafe for LocatorJs
impl Send for LocatorJs
impl Sync for LocatorJs
impl Unpin for LocatorJs
impl UnsafeUnpin for LocatorJs
impl !UnwindSafe for LocatorJs
Blanket Implementations§
Source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
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>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.