rs_rich.ext: the rs-rich-ext crate from Python (no Rich counterpart).
Everything the port adds on top of Rich: diagnostics and stack traces,
structured data, diffs and test reports, transforms, workflow renderables,
terminal capabilities, inspectors and the extension registry. Each Rust
module is a submodule here (diagnostic, stacktrace, dashboard, hyperlink, highlighter, event, log_handler, data, transform, diff, workflow, cancel, transfer, countdown, notify, table, badge, size_bar, format, redact, capabilities, fidelity, a11y, ansi_explain, sanitize, encoding, target, frame, source_view, hex, unicode_inspect, env_inspect, derive, layout, live, theme, cli_doc, testing, qa);
this package re-exports all of them.
MAX_TRACE_CAUSES
module-attribute
EVENT_KEYWORDS
module-attribute
EVENT_KEYWORDS: List[Any]
SECRET_KEYS
module-attribute
DIFF_STYLES
module-attribute
WORKFLOW_STATES
module-attribute
WORKFLOW_STATES: List[Any]
WORKFLOW_STYLES
module-attribute
WORKFLOW_STYLES: List[Any]
TRANSFER_STYLES
module-attribute
TRANSFER_STYLES: List[Any]
TABLE_STYLES
module-attribute
BADGE_STYLES
module-attribute
SIZE_BAR_STYLES
module-attribute
SIZE_BAR_STYLES: List[Any]
REDACT_DETECTORS
module-attribute
REDACT_DETECTORS: List[Any]
CAPABILITY_OVERRIDE_VARS
module-attribute
CAPABILITY_OVERRIDE_VARS: List[Any]
FIDELITY_LEVELS
module-attribute
FIDELITY_LEVELS: List[Any]
MAX_BYTES_PER_LINE
module-attribute
OS_PATH_SEPARATOR
module-attribute
STYLE_TABLES
module-attribute
HELP_STYLES
module-attribute
HELP_STACK_BELOW
module-attribute
COMPLETION_SHELLS
module-attribute
COMPLETION_SHELLS: List[Any]
Diagnostic
code_url
property
writable
hyperlinker
property
writable
location
property
writable
overflow
property
writable
add_cause
add_cause(message: Any) -> Any
add_help
add_help(message: Any) -> Any
add_label
add_label(message: Any) -> Any
add_metadata(key: Any, value: Any) -> Any
add_note
add_note(message: Any) -> Any
add_snippet
add_snippet(snippet: Any) -> Any
add_suggestion
add_suggestion(suggestion: Any) -> Any
error
classmethod
error(message: Any, **kwargs: Any) -> Any
from_exception
classmethod
from_exception(exception: Any, *, max_depth: Any = ..., level: Any = ..., trace: Any = ..., view: Any = ...) -> Any
warning
classmethod
warning(message: Any, **kwargs: Any) -> Any
SourceSnippet
primary
primary(start: Any, end: Any, label: Any = ...) -> Any
secondary
secondary(start: Any, end: Any, label: Any = ...) -> Any
Suggestion
replace
classmethod
replace(message: Any, source: Any, start: Any, end: Any, replacement: Any) -> Any
StackTrace
hyperlinker
property
writable
show_library
property
writable
from_exception
staticmethod
from_exception(exception: Any) -> Any
parse
staticmethod
parse(text: Any, *, parsers: Any = ...) -> Any
DiagnosticsDashboard
min_level
property
writable
top_codes
property
writable
extend
extend(diagnostics: Any) -> Any
push
push(diagnostic: Any) -> Any
Hyperlinker
file_url
file_url(path: Any, line: Any = ..., column: Any = ...) -> Any
highlight
highlight(text: Any) -> Any
location
location(path: Any, line: Any = ..., column: Any = ..., style: Any = ...) -> Any
reference_url
reference_url(number: Any, repo: Any = ...) -> Any
NumberHighlighter
highlight
highlight(text: Any) -> Any
StructuredEvent
add_diagnostic
add_diagnostic(diagnostic: Any) -> Any
field
field(key: Any, value: Any) -> Any
EventHandler
emit
emit(console: Any, event: Any) -> Any
level_text
staticmethod
level_text(severity: Any) -> Any
render
render(event: Any) -> Any
render_message
render_message(event: Any) -> Any
DataNode
from_python
staticmethod
from_python(value: Any) -> Any
get
get(key: Any, default: Any = ...) -> Any
redacted
redacted(redaction: Any) -> Any
to_json
to_json(*, indent: Any = ...) -> Any
Explorer
max_depth
property
writable
max_length
property
writable
max_string
property
writable
root_label
property
writable
show_paths
property
writable
show_types
property
writable
highlight
highlight(at: Any, style: Any) -> Any
Redaction
matches_key
matches_key(key: Any) -> Any
Select
apply
apply(document: Any) -> Any
Filter
apply
apply(document: Any) -> Any
Highlight
apply
apply(document: Any) -> Any
Redact
apply
apply(document: Any) -> Any
Pipeline
then
then(name: Any, stage: Any) -> Any
TextDiff
unified
unified(old_name: Any = ..., new_name: Any = ...) -> Any
DiffView
from_diff
classmethod
from_diff(diff: Any, *, layout: Any = ..., line_numbers: Any = ..., wrap: Any = ..., titles: Any = ..., emphasis: Any = ...) -> Any
style_changed_lines
style_changed_lines() -> Any
TemplateLinks
file_url
file_url(path: Any) -> Any
line_url
line_url(path: Any, line: Any) -> Any
TestRun
from_junit
staticmethod
from_junit(xml: Any) -> Any
from_libtest
staticmethod
from_libtest(json: Any) -> Any
ManualClock
advance
advance(seconds: Any) -> Any
TaskTree
add
add(label: Any, parent: Any = ...) -> Any
children
children(task: Any) -> Any
elapsed
elapsed(task: Any) -> Any
fail
fail(task: Any, message: Any) -> Any
get_note
get_note(task: Any) -> Any
get_progress
get_progress(task: Any) -> Any
note
note(task: Any, note: Any) -> Any
progress
progress(task: Any, completed: Any, total: Any = ...) -> Any
skip
skip(task: Any, reason: Any = ...) -> Any
succeed
succeed(task: Any) -> Any
summary
summary(*, next_steps: Any = ..., show_all_items: Any = ..., symbols: Any = ..., policy: Any = ...) -> Any
view
view(*, collapse_finished: Any = ..., show_durations: Any = ..., symbols: Any = ..., animate: Any = ..., policy: Any = ...) -> Any
warn
warn(task: Any, message: Any) -> Any
SummaryItem
from_record
classmethod
from_record(record: Any) -> Any
CommandRecord
duration
property
writable
output
output(stream: Any = ...) -> Any
push
push(stream: Any, text: Any) -> Any
view
view(*, tail: Any = ..., full_on_failure: Any = ..., show_cwd: Any = ..., show_diagnostic: Any = ..., help: Any = ..., symbols: Any = ..., animate: Any = ..., policy: Any = ...) -> Any
Transfer
advance
advance(nbytes: Any, *, now: Any = ...) -> Any
finish
finish(*, now: Any = ...) -> Any
pause
pause(*, now: Any = ...) -> Any
retry
retry(reason: Any) -> Any
start
start(*, now: Any = ...) -> Any
update
update(nbytes: Any, *, now: Any = ...) -> Any
wrap_reader
wrap_reader(file: Any, *, cancel: Any = ...) -> Any
wrap_writer
wrap_writer(file: Any, *, cancel: Any = ...) -> Any
Transfers
summary
property
writable
push
push(transfer: Any) -> Any
TransferReader
read
read(size: Any = ...) -> Any
Backoff
delay
delay(attempt: Any) -> Any
delays
delays(limit: Any = ...) -> Any
status
status(attempt: Any, reason: Any) -> Any
Notifications
push
push(notification: Any, now: Any) -> Any
Aggregate
compute
compute(values: Any) -> Any
custom
staticmethod
custom(column: Any, function: Any) -> Any
TableData
sort_by
sort_by(keys: Any) -> Any
StreamingTable
sort_by
sort_by(keys: Any) -> Any
update_cell
update_cell(key: Any, column: Any, v: Any) -> Any
upsert
upsert(key: Any, values: Any) -> Any
Badge
label
staticmethod
label(text: Any, *, style: Any = ..., symbols: Any = ...) -> Any
link
staticmethod
link(text: Any, url: Any, *, style: Any = ..., symbols: Any = ..., show_url: Any = ...) -> Any
meta(key: Any, value: Any, *, style: Any = ..., symbols: Any = ...) -> Any
status
staticmethod
status(status: Any, message: Any, *, style: Any = ..., symbols: Any = ...) -> Any
SizeBar
limit
staticmethod
limit(used: Any, limit: Any, *, label: Any = ..., units: Any = ..., bar_width: Any = ..., warn_at: Any = ..., show_sizes: Any = ..., show_percent: Any = ...) -> Any
Redactor
capture
capture(renderable: Any, *, width: Any = ..., color: Any = ...) -> Any
export_html
export_html(renderable: Any, *, width: Any = ..., inline_styles: Any = ...) -> Any
export_svg
export_svg(renderable: Any, *, width: Any = ..., title: Any = ..., unique_id: Any = ...) -> Any
export_text
export_text(renderable: Any, *, width: Any = ...) -> Any
redact_ansi
redact_ansi(text: Any) -> Any
redact_args
redact_args(args: Any) -> Any
redact_byte_chunks
redact_byte_chunks(chunks: Any) -> Any
redact_chunks
redact_chunks(chunks: Any) -> Any
redact_segments
redact_segments(segments: Any) -> Any
AccessibilityPolicy
fidelity_ceiling
fidelity_ceiling() -> Any
for_high_contrast
staticmethod
for_high_contrast() -> Any
for_monochrome
staticmethod
for_reduced_motion
staticmethod
for_reduced_motion() -> Any
for_screen_reader
staticmethod
for_screen_reader() -> Any
from_env
staticmethod
from_env(env: Any = ...) -> Any
status
status(status: Any) -> Any
theme
theme(theme: Any = ...) -> Any
ExplanationView
inline_text
inline_text(ascii: Any = ...) -> Any
RenderTarget
frame
frame(renderable: Any) -> RenderFrame
segments
segments(renderable: Any) -> Any
text
text(renderable: Any) -> Any
RenderFrame
rs_rich.ext.frame.Frame: a render as rows of styled runs (rich_ext::frame).
ends_with_newline
property
from_segments
staticmethod
from_segments(segments: Iterable[Segment]) -> RenderFrame
from_console
staticmethod
from_console(console: Console, renderable: Any, options: Optional[ConsoleOptions] = None) -> RenderFrame
row_width
row_width(row: int) -> int
row
row(row: int) -> List[Tuple[str, int, Optional[Style]]]
cells
cells(row: int) -> List[Tuple[str, int, Optional[Style]]]
to_ansi
to_ansi(console: Console) -> str
to_ansi_merged
to_ansi_merged(console: Console) -> str
encode
encode(color_system: Optional[str] = 'truecolor', no_color: bool = False) -> str
encode_span
encode_span(row: int, start: int, end: int, color_system: Optional[str] = 'truecolor', no_color: bool = False) -> str
diff
diff(previous: RenderFrame) -> List[Tuple[int, range]]
HexView
line_width
line_width(n: Any) -> Any
resolved_bytes_per_line
resolved_bytes_per_line(width: Any) -> Any
GraphemeCluster
display
display(ascii: Any = ...) -> Any
EnvView
is_redacted
is_redacted(name: Any) -> Any
Record
from_object
classmethod
from_object(obj: Any, *, title: Any = ..., presentation: Any = ...) -> Any
LayoutNode
split
staticmethod
split(axis: Any, children: Any, *, width: Any = ..., height: Any = ..., content_width: Any = ..., content_height: Any = ..., align: Any = ..., overflow: Any = ...) -> Any
LiveCoordinator
add
add(renderable: Any) -> Any
countdown
countdown(total: Any, frame: Any, *, tick: Any = ..., cancel: Any = ..., animate: Any = ..., policy: Any = ..., sleep: Any = ...) -> Any
present
present(notifications: Any, now: Any) -> Any
print
print(renderable: Any) -> Any
remove
remove(region: Any) -> Any
resize
resize(width: Any, height: Any) -> Any
update
update(region: Any, renderable: Any) -> Any
ArgSpec
flag
staticmethod
flag(long: Any, **kwargs: Any) -> Any
option
staticmethod
option(long: Any, **kwargs: Any) -> Any
positional
staticmethod
positional(name: Any, **kwargs: Any) -> Any
CommandSpec
completion
completion(shell: Any) -> Any
completion_catalog
completion_catalog() -> Any
config_reference
config_reference() -> Any
find_subcommand
find_subcommand(name: Any) -> Any
help
help(*, long: Any = ..., path: Any = ...) -> Any
subcommand_names
subcommand_names() -> Any
to_man
to_man(section: Any = ..., date: Any = ...) -> Any
to_man_pages
to_man_pages(section: Any = ..., date: Any = ...) -> Any
unknown
unknown(argument: Any) -> Any
CliError
invalid_value
classmethod
invalid_value(argument: Any, value: Any, possible: Any) -> Any
missing_required
classmethod
missing_required(arguments: Any) -> Any
missing_value
classmethod
missing_value(argument: Any) -> Any
unknown_argument
classmethod
unknown_argument(argument: Any, candidates: Any) -> Any
unknown_subcommand
classmethod
unknown_subcommand(name: Any, candidates: Any) -> Any
ConfigReference
from_spec
classmethod
from_spec(spec: Any, *, description: Any = ..., sources: Any = ..., entries: Any = ...) -> Any
parse_stacktrace
parse_stacktrace(text: Any, *, parsers: Any = ...) -> Any
parse_data
parse_data(content: Any, format: Any = ..., *, name: Any = ...) -> Any
detect_format(content: Any, name: Any = ...) -> Any
format_for(file_name: Any) -> Any
flatten
flatten(data: Any) -> Any
unflatten
unflatten(leaves: Any) -> Any
search
search(data: Any, query: Any = ..., **kwargs: Any) -> Any
select
select(data: Any, expression: Any, *, backend: Any = ...) -> Any
selector_backends
selector_backends() -> Any
diff_data
diff_data(old: Any, new: Any) -> Any
diff_sequences
diff_sequences(old: Any, new: Any) -> Any
diff_lines
diff_lines(old: Any, new: Any) -> Any
diff_words
diff_words(old: Any, new: Any) -> Any
diff_chars
diff_chars(old: Any, new: Any) -> Any
tokenize
tokenize(text: Any) -> Any
hunk_header(old: Any, new: Any) -> Any
group_hunks
group_hunks(ops: Any, context: Any = ...) -> Any
parse_patch
parse_patch(text: Any) -> Any
state_marker
state_marker(state: Any, symbols: Any = ...) -> Any
state_label
state_label(state: Any, count: Any) -> Any
run_command
run_command(args: Any, *, cwd: Any = ..., env: Any = ..., cancel: Any = ..., tick: Any = ..., on_update: Any = ...) -> Any
remaining_label
remaining_label(seconds: Any) -> Any
countdown_wait
countdown_wait(total: Any, *, tick: Any = ..., cancel: Any = ..., on_tick: Any = ..., sleep: Any = ...) -> Any
format_size(n: Any, *, units: Any = ...) -> Any
format_rate(bytes_per_second: Any) -> Any
format_duration(seconds: Any, *, ascii: Any = ...) -> Any
format_clock(seconds: Any) -> Any
format_relative(then: Any, now: Any) -> Any
format_timestamp(t: Any) -> Any
format_percent(ratio: Any, decimals: Any = ...) -> Any
format_number(n: Any) -> Any
format_compact(n: Any) -> Any
is_secret_key
is_secret_key(key: Any) -> Any
detect_capabilities
detect_capabilities(env: Any = ..., *, terminal: Any = ..., size: Any = ..., windows: Any = ..., color: Any = ..., unicode: Any = ..., hyperlinks: Any = ..., graphics: Any = ..., sixel: Any = ..., animation: Any = ..., interactive: Any = ..., width: Any = ..., height: Any = ...) -> Any
select_fidelity
select_fidelity(*, unicode: Any = ..., color: Any = ..., interactive: Any = ..., animation: Any = ..., ceiling: Any = ..., floor: Any = ..., allow_animation: Any = ...) -> Any
degrade_segments
degrade_segments(segments: Any, level: Any) -> Any
ascii_text
ascii_text(text: Any) -> Any
status_marker
status_marker(status: Any, symbols: Any = ...) -> Any
contrast_ratio
contrast_ratio(a: Any, b: Any) -> Any
relative_luminance
relative_luminance(color: Any) -> Any
delta_e
delta_e(a: Any, b: Any) -> Any
to_lab
to_lab(color: Any) -> Any
simulate_deficiency
simulate_deficiency(color: Any, deficiency: Any) -> Any
suggest_color
suggest_color(fg: Any, bg: Any, min_ratio: Any = ...) -> Any
check_theme
check_theme(theme: Any = ..., *, backgrounds: Any = ..., min_ratio: Any = ..., error_ratio: Any = ..., cvd_threshold: Any = ..., groups: Any = ...) -> Any
semantic_text
semantic_text(renderable: Any, width: Any = ...) -> Any
accessible_text
accessible_text(renderable: Any, width: Any = ...) -> Any
explain
explain(text: Any) -> Any
sgr_effects
sgr_effects(params: Any) -> Any
csi_meaning
csi_meaning(params: Any, intermediates: Any, final: Any) -> Any
osc_meaning
osc_meaning(data: Any) -> Any
control_name
control_name(byte: Any) -> Any
escape_visible
escape_visible(raw: Any) -> Any
sanitize_terminal_controls
sanitize_terminal_controls(text: Any) -> Any
sanitize_terminal_and_bidi_controls
sanitize_terminal_and_bidi_controls(text: Any) -> Any
sanitize_single_line
sanitize_single_line(text: Any) -> Any
is_bidi_control
is_bidi_control(char: Any) -> Any
decode_text
decode_text(data: Any, encoding: Any) -> Any
has_utf16_bom
has_utf16_bom(data: Any) -> Any
resolve_target_capabilities
resolve_target_capabilities(*, width: Any = ..., height: Any = ..., is_terminal: Any = ..., color_system: Any = ..., unicode: Any = ..., hyperlinks: Any = ..., sixel: Any = ..., overrides: Any = ...) -> Any
find_all
find_all(haystack: Any, needle: Any) -> Any
byte_class
byte_class(byte: Any) -> Any
classify_cluster
classify_cluster(cluster: Any, width: Any) -> Any
control_picture
control_picture(char: Any, ascii: Any = ...) -> Any
is_secret_name
is_secret_name(name: Any) -> Any
redact_value
redact_value(value: Any) -> Any
name_matches
name_matches(pattern: Any, name: Any) -> Any
is_path_like
is_path_like(name: Any, value: Any, separator: Any = ...) -> Any
records_table
records_table(records: Any) -> Any
allocate
allocate(total: Any, constraints: Any) -> Any
fit_segments
fit_segments(segments: Any, width: Any, overflow: Any = ...) -> Any
suggest
suggest(input: Any, candidates: Any) -> Any
render_snapshot
render_snapshot(renderable: Any, *, target: Any = ..., width: int = ...) -> Dict[str, Any]
assert_render_eq
assert_render_eq(renderable: Any, expected: str, width: int = ..., message: Optional[str] = ...) -> None
assert_str_eq
assert_str_eq(left: str, right: str, message: Optional[str] = ...) -> None
assert_json_eq
assert_json_eq(left: Any, right: Any, message: Optional[str] = ...) -> None
highlighter_conformance(highlighter: Any, *, all_themes: bool = ..., scaling: bool = ...) -> None
qa_screenshot
qa_screenshot(name: str, renderable: Any, *, widths: Optional[List[int]] = ..., color: Optional[List[str]] = ..., unicode: Optional[List[bool]] = ..., hyperlinks: bool = ..., height: Optional[int] = ..., approvals: Any = ..., approve: Optional[bool] = ...) -> List[Dict[str, Any]]
qa_stress
qa_stress(renderable: Any, *, widths: Optional[List[int]] = ..., heights: Optional[List[Optional[int]]] = ..., unicode: bool = ..., line_tolerance: int = ..., strict_minimum: bool = ...) -> QaReport
qa_lint
qa_lint(renderable: Any, *, widths: Optional[List[int]] = ..., color: str = ..., unicode: bool = ..., hyperlinks: bool = ..., layout: bool = ...) -> QaReport
qa_explain
qa_explain(renderable: Any, target: Any = ..., *, width: int = ...) -> QaReport
qa_profile
qa_profile(renderable: Any, *, width: int = ..., iterations: int = ..., warmup: int = ..., frame: Optional[Tuple[int, int]] = ...) -> QaReport
qa_fuzz
qa_fuzz(seed: int = ..., cases: int = ...) -> QaReport
qa_matrix
qa_matrix(fixtures: Dict[str, Any], *, profiles: Optional[List[str]] = ..., width: int = ...) -> QaReport
qa_bench
qa_bench(name: str, renderable: Any, *, width: int = ..., warmup: float = ..., target_time: float = ..., min_samples: int = ..., max_samples: int = ...) -> QaReport