Skip to main content

GraphBuildHelper

Struct GraphBuildHelper 

Source
pub struct GraphBuildHelper<'a> { /* private fields */ }
Expand description

Helper for building graphs in GraphBuilder implementations.

Provides high-level abstractions over StagingGraph that handle:

  • String interning with local ID tracking
  • Qualified name deduplication
  • Node and edge creation with proper types

Implementations§

Source§

impl<'a> GraphBuildHelper<'a>

Source

pub fn new( staging: &'a mut StagingGraph, file: &Path, language: Language, ) -> Self

Create a new helper for the given staging graph and file.

The file_id should be pre-allocated by the caller (typically 0 for per-file staging buffers).

Source

pub fn with_file_id( staging: &'a mut StagingGraph, file: &Path, language: Language, file_id: FileId, ) -> Self

Create a helper with a specific file ID.

Source

pub fn language(&self) -> Language

Get the language for this helper.

Source

pub fn file_id(&self) -> FileId

Get the file ID for this helper.

Source

pub fn file_path(&self) -> &str

Get the file path.

Source

pub fn intern(&mut self, s: &str) -> StringId

Intern a string and get a local StringId.

Strings are deduplicated: calling with the same value returns the same ID. The local StringId is passed to the staging graph so that during commit_strings(), a remap table from local to global IDs can be built.

Source

pub fn has_node(&self, qualified_name: &str) -> bool

Check if a node with the given qualified name already exists.

Source

pub fn get_node(&self, qualified_name: &str) -> Option<NodeId>

Get an existing node by qualified name.

Source

pub fn has_node_with_kind(&self, qualified_name: &str, kind: NodeKind) -> bool

Check if a node with the given qualified name and kind already exists.

Source

pub fn get_node_with_kind( &self, qualified_name: &str, kind: NodeKind, ) -> Option<NodeId>

Get an existing node by qualified name and kind.

Source

pub fn add_function( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_unsafe: bool, ) -> NodeId

Add a function node with the given qualified name.

Returns the NodeId (creating the node if it doesn’t exist).

Source

pub fn add_function_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_unsafe: bool, visibility: Option<&str>, ) -> NodeId

Add a function node with visibility.

Returns the NodeId (creating the node if it doesn’t exist).

Source

pub fn add_function_with_signature( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_unsafe: bool, visibility: Option<&str>, signature: Option<&str>, ) -> NodeId

Add a function node with signature (return type).

The signature is used for returns: queries. Returns the NodeId (creating the node if it doesn’t exist).

Source

pub fn add_method( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_static: bool, ) -> NodeId

Add a method node with the given qualified name.

Source

pub fn add_method_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_static: bool, visibility: Option<&str>, ) -> NodeId

Add a method node with visibility.

Source

pub fn add_method_with_signature( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_static: bool, visibility: Option<&str>, signature: Option<&str>, ) -> NodeId

Add a method node with signature (return type).

The signature is used for returns: queries. Returns the NodeId (creating the node if it doesn’t exist).

Source

pub fn add_class(&mut self, qualified_name: &str, span: Option<Span>) -> NodeId

Add a class node.

Source

pub fn add_class_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, visibility: Option<&str>, ) -> NodeId

Add a class node with visibility.

Source

pub fn add_struct(&mut self, qualified_name: &str, span: Option<Span>) -> NodeId

Add a struct node.

Source

pub fn add_struct_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, visibility: Option<&str>, ) -> NodeId

Add a struct node with visibility.

Source

pub fn add_module(&mut self, qualified_name: &str, span: Option<Span>) -> NodeId

Add a module node.

Source

pub fn add_resource( &mut self, qualified_name: &str, span: Option<Span>, ) -> NodeId

Add a resource node.

Source

pub fn add_endpoint( &mut self, qualified_name: &str, span: Option<Span>, ) -> NodeId

Add an endpoint node for HTTP route handlers.

The qualified name should follow the convention route::{METHOD}::{path}, for example route::GET::/api/users or route::POST::/api/items.

Endpoint nodes are used by Pass 5 (cross-language linking) to match HTTP requests from client code to server-side route handlers.

Source

pub fn add_import(&mut self, qualified_name: &str, span: Option<Span>) -> NodeId

Add an import node.

Source

pub fn add_verbatim_import(&mut self, name: &str, span: Option<Span>) -> NodeId

Add an import node while preserving the original path-like identifier.

Use this for resource imports such as styles.css, app.js, or similar asset filenames where . is part of the path rather than a language-native qualified-name separator.

Source

pub fn add_variable( &mut self, qualified_name: &str, span: Option<Span>, ) -> NodeId

Add a variable node.

Source

pub fn add_verbatim_variable( &mut self, name: &str, span: Option<Span>, ) -> NodeId

Add a variable node while preserving the original identifier exactly.

Use this for static asset references where the literal path is the graph identity.

Source

pub fn add_constant( &mut self, qualified_name: &str, span: Option<Span>, ) -> NodeId

Add a constant node.

Source

pub fn add_constant_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, visibility: Option<&str>, ) -> NodeId

Add a constant node with visibility.

Source

pub fn add_constant_with_static_and_visibility( &mut self, qualified_name: &str, span: Option<Span>, is_static: bool, visibility: Option<&str>, ) -> NodeId

Add a constant node with static and visibility attributes.

Source

pub fn add_property_with_static_and_visibility( &mut self, qualified_name: &str, span: Option<Span>, is_static: bool, visibility: Option<&str>, ) -> NodeId

Add a property node with static and visibility attributes.

Source

pub fn add_enum(&mut self, qualified_name: &str, span: Option<Span>) -> NodeId

Add an enum node.

Source

pub fn add_enum_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, visibility: Option<&str>, ) -> NodeId

Add an enum node with visibility.

Source

pub fn add_interface( &mut self, qualified_name: &str, span: Option<Span>, ) -> NodeId

Add an interface/trait node.

Source

pub fn add_interface_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, visibility: Option<&str>, ) -> NodeId

Add an interface/trait node with visibility.

Source

pub fn add_type(&mut self, qualified_name: &str, span: Option<Span>) -> NodeId

Add a type alias node.

Source

pub fn add_type_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, visibility: Option<&str>, ) -> NodeId

Add a type alias node with visibility.

Source

pub fn add_lifetime( &mut self, qualified_name: &str, span: Option<Span>, ) -> NodeId

Add a lifetime node.

Source

pub fn add_lifetime_constraint_edge( &mut self, source: NodeId, target: NodeId, constraint_kind: LifetimeConstraintKind, )

Add a lifetime constraint edge.

Source

pub fn add_trait_method_binding_edge( &mut self, caller: NodeId, callee: NodeId, trait_name: &str, impl_type: &str, is_ambiguous: bool, )

Add a trait method binding edge.

This edge represents the resolution of a trait method call to a concrete implementation.

Source

pub fn add_macro_expansion_edge( &mut self, invocation: NodeId, expansion: NodeId, expansion_kind: MacroExpansionKind, is_verified: bool, )

Add a macro expansion edge.

Represents the expansion of a macro invocation to its generated code. Only available when macro expansion is enabled.

§Arguments
  • invocation - The macro invocation site node (e.g., derive attribute or macro call)
  • expansion - The macro definition or generated code node
  • expansion_kind - The kind of macro expansion (Derive, Attribute, Declarative, Function)
  • is_verified - Whether the expansion has been verified (requires cargo expand)
§Example
// #[derive(Debug)] on a struct
let struct_id = helper.add_struct("MyStruct", Some(span));
let derive_macro_id = helper.add_node("MyStruct::derive_Debug", None, NodeKind::Macro);
helper.add_macro_expansion_edge(
    struct_id,
    derive_macro_id,
    MacroExpansionKind::Derive,
    false,
);
Source

pub fn add_node( &mut self, qualified_name: &str, span: Option<Span>, kind: NodeKind, ) -> NodeId

Add a generic node with custom kind.

Source

pub fn add_node_with_visibility( &mut self, qualified_name: &str, span: Option<Span>, kind: NodeKind, visibility: Option<&str>, ) -> NodeId

Add a generic node with visibility.

Source

pub fn add_call_edge(&mut self, caller: NodeId, callee: NodeId)

Add a call edge from caller to callee.

Source

pub fn add_call_edge_with_span( &mut self, caller: NodeId, callee: NodeId, spans: Vec<Span>, )

Add a call edge from caller to callee with source span information.

The span should point to the call site location in source code.

§Note

This method uses default metadata (argument_count: 255 sentinel for unknown, is_async: false). Use add_call_edge_full when you need to specify argument count or async status explicitly.

Source

pub fn add_call_edge_full( &mut self, caller: NodeId, callee: NodeId, argument_count: u8, is_async: bool, )

Add a call edge with full metadata.

Use this method when you know the argument count or when the call is async. For calls where metadata is unknown, use add_call_edge which uses default values (argument_count: 255 sentinel, is_async: false).

§Arguments
  • caller - The node making the call
  • callee - The node being called
  • argument_count - Number of arguments in the call (0-254, use 255 for unknown)
  • is_async - Whether this is an async/await call
§Canonical Usage
ScenarioMethod
Argument count known, sync calladd_call_edge_full(caller, callee, arg_count, false)
Argument count known, async calladd_call_edge_full(caller, callee, arg_count, true)
Argument count unknown, sync calladd_call_edge(caller, callee) or add_call_edge_full(caller, callee, 255, false)
§Example
// Function call with 3 arguments
helper.add_call_edge_full(main_id, helper_id, 3, false);

// Async call with 1 argument
helper.add_call_edge_full(main_id, async_fn_id, 1, true);
Source

pub fn add_call_edge_full_with_span( &mut self, caller: NodeId, callee: NodeId, argument_count: u8, is_async: bool, spans: Vec<Span>, )

Add a call edge with full metadata and source span information.

Combines the functionality of add_call_edge_full and span tracking.

Source

pub fn add_table_read_edge_with_span( &mut self, reader: NodeId, table: NodeId, table_name: &str, schema: Option<&str>, spans: Vec<Span>, )

Add a database table read edge (SQL).

Source

pub fn add_table_write_edge_with_span( &mut self, writer: NodeId, table: NodeId, table_name: &str, schema: Option<&str>, operation: TableWriteOp, spans: Vec<Span>, )

Add a database table write edge (SQL).

Source

pub fn add_triggered_by_edge_with_span( &mut self, trigger: NodeId, table: NodeId, trigger_name: &str, schema: Option<&str>, spans: Vec<Span>, )

Add a database trigger relationship edge (SQL).

Convention: trigger -> table with EdgeKind::TriggeredBy.

Source

pub fn add_import_edge(&mut self, importer: NodeId, imported: NodeId)

Add an import edge from importer to imported module/symbol.

This method uses default metadata (alias: None, is_wildcard: false). Use add_import_edge_full when importing with an alias or for wildcard imports.

Source

pub fn add_import_edge_full( &mut self, importer: NodeId, imported: NodeId, alias: Option<&str>, is_wildcard: bool, )

Add an import edge with full metadata.

Use this method when the import has an alias or is a wildcard import. For simple imports without alias or wildcard, use add_import_edge.

§Arguments
  • importer - The node importing (e.g., module or file)
  • imported - The node being imported
  • alias - Optional alias string (e.g., for import { foo as bar }, alias is “bar”)
  • is_wildcard - Whether this is a wildcard import (e.g., import *)
§Canonical Usage
Import SyntaxMethod
import fooadd_import_edge(importer, imported)
import foo as baradd_import_edge_full(importer, imported, Some("bar"), false)
import * / import *.*add_import_edge_full(importer, imported, None, true)
import * as nsadd_import_edge_full(importer, imported, Some("ns"), true)
§Example
// import { HashMap as Map } from "std::collections"
let alias_id = helper.intern("Map");
helper.add_import_edge_full(module_id, hashmap_id, Some("Map"), false);

// import * from "lodash"
helper.add_import_edge_full(module_id, lodash_id, None, true);
Source

pub fn add_export_edge(&mut self, module: NodeId, exported: NodeId)

Add an export edge from module to exported symbol.

This method uses default metadata (kind: ExportKind::Direct, alias: None). Use add_export_edge_full for re-exports, default exports, namespace exports, or exports with aliases.

Source

pub fn add_export_edge_full( &mut self, module: NodeId, exported: NodeId, kind: ExportKind, alias: Option<&str>, )

Add an export edge with full metadata.

Use this method for re-exports, default exports, namespace exports, or exports with aliases. For simple direct exports without alias, use add_export_edge.

§Arguments
  • module - The module/file node that contains the export
  • exported - The symbol being exported
  • kind - The kind of export:
    • ExportKind::Direct - Direct export (export { foo })
    • ExportKind::Reexport - Re-export from another module (export { foo } from "mod")
    • ExportKind::Default - Default export (export default foo)
    • ExportKind::Namespace - Namespace export (export * as ns from "mod")
  • alias - Optional alias string (e.g., for export { foo as bar }, alias is “bar”)
§Canonical Usage
Export Syntax (JS/TS)Method
export { name }add_export_edge(module, name)
export default fooadd_export_edge_full(module, foo, ExportKind::Default, None)
export { foo as bar }add_export_edge_full(module, foo, ExportKind::Direct, Some("bar"))
export { foo } from "mod"add_export_edge_full(module, foo, ExportKind::Reexport, None)
export { foo as bar } from "mod"add_export_edge_full(module, foo, ExportKind::Reexport, Some("bar"))
export * from "mod"add_export_edge_full(module, mod, ExportKind::Reexport, None)
export * as ns from "mod"add_export_edge_full(module, mod, ExportKind::Namespace, Some("ns"))
§Example
// export default MyComponent;
helper.add_export_edge_full(module_id, component_id, ExportKind::Default, None);

// export { helper as utilHelper };
helper.add_export_edge_full(module_id, helper_id, ExportKind::Direct, Some("utilHelper"));

// export * as utils from "./utils";
helper.add_export_edge_full(module_id, utils_id, ExportKind::Namespace, Some("utils"));
Source

pub fn add_reference_edge(&mut self, from: NodeId, to: NodeId)

Add a reference edge (variable/field access).

Source

pub fn add_defines_edge(&mut self, parent: NodeId, child: NodeId)

Add a defines edge (module defines symbol).

Source

pub fn add_typeof_edge(&mut self, source: NodeId, target: NodeId)

Add a type-of edge (symbol has type). Add a TypeOf edge without context metadata (backward compatibility).

For new code, prefer add_typeof_edge_with_context to provide semantic context.

Source

pub fn add_typeof_edge_with_context( &mut self, source: NodeId, target: NodeId, context: Option<TypeOfContext>, index: Option<u16>, name: Option<&str>, )

Add a TypeOf edge with optional context metadata.

§Parameters
  • source: The node that has this type (e.g., variable, function, parameter)
  • target: The type node
  • context: Where this type reference appears (Parameter, Return, Field, Variable, etc.)
  • index: Position/index (for parameters, returns, fields)
  • name: Name (for parameters, returns, fields, variables)
§Examples
// Function parameter: func foo(ctx context.Context)
helper.add_typeof_edge_with_context(
    func_id,
    type_id,
    Some(TypeOfContext::Parameter),
    Some(0),
    Some("ctx"),
);

// Function return: func bar() error
helper.add_typeof_edge_with_context(
    func_id,
    error_type_id,
    Some(TypeOfContext::Return),
    Some(0),
    None,
);

// Variable: var x int
helper.add_typeof_edge_with_context(
    var_id,
    int_type_id,
    Some(TypeOfContext::Variable),
    None,
    Some("x"),
);
Source

pub fn add_implements_edge(&mut self, implementor: NodeId, interface: NodeId)

Add an implements edge (class implements interface).

Source

pub fn add_inherits_edge(&mut self, child: NodeId, parent: NodeId)

Add an inherits edge (class extends class).

Source

pub fn add_contains_edge(&mut self, parent: NodeId, child: NodeId)

Add a contains edge (parent contains child, e.g., class contains method).

Source

pub fn add_webassembly_edge(&mut self, caller: NodeId, wasm_target: NodeId)

Add a WebAssembly call edge.

Used when JavaScript/TypeScript code instantiates or calls WebAssembly modules:

  • WebAssembly.instantiate() / WebAssembly.instantiateStreaming()
  • new WebAssembly.Module() / new WebAssembly.Instance()
  • Calling exported WASM functions
Source

pub fn add_ffi_edge( &mut self, caller: NodeId, ffi_target: NodeId, convention: FfiConvention, )

Add an FFI call edge with the specified calling convention.

Used for foreign function interface calls:

  • Node.js native addons (.node files)
  • ctypes/cffi in Python
  • JNI in Java
  • P/Invoke in C#
Source

pub fn add_http_request_edge( &mut self, caller: NodeId, target: NodeId, method: HttpMethod, url: Option<&str>, )

Add an HTTP request edge.

Use this when detecting HTTP calls like fetch() or axios.get().

Source

pub fn ensure_function( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_unsafe: bool, ) -> NodeId

Ensure a function node exists, creating it if needed.

This is a convenience method that matches the legacy ensure_function_node pattern.

Source

pub fn ensure_method( &mut self, qualified_name: &str, span: Option<Span>, is_async: bool, is_static: bool, ) -> NodeId

Ensure a method node exists, creating it if needed.

Source

pub fn stats(&self) -> HelperStats

Get statistics about what’s been staged.

Trait Implementations§

Source§

impl<'a> Debug for GraphBuildHelper<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GraphBuildHelper<'a>

§

impl<'a> RefUnwindSafe for GraphBuildHelper<'a>

§

impl<'a> Send for GraphBuildHelper<'a>

§

impl<'a> Sync for GraphBuildHelper<'a>

§

impl<'a> Unpin for GraphBuildHelper<'a>

§

impl<'a> UnsafeUnpin for GraphBuildHelper<'a>

§

impl<'a> !UnwindSafe for GraphBuildHelper<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> 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<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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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