pub struct DcDocumentNavigator<'a> { /* private fields */ }Implementations§
Sourcepub fn decode_frame_with_arena<T: DcMixedDecode>(
&mut self,
stub: &DcFrameStub,
arena: &mut DcSyntaxArena<'a>,
context: Option<&SharedValueContext>,
policy: &DcProjectionPolicy,
) -> Result<T>
pub fn decode_frame_with_arena<T: DcMixedDecode>( &mut self, stub: &DcFrameStub, arena: &mut DcSyntaxArena<'a>, context: Option<&SharedValueContext>, policy: &DcProjectionPolicy, ) -> Result<T>
Decodes a DcFrameStub into a typed Rust value T using the given
SharedValueContext and DcProjectionPolicy, reusing the provided
DcSyntaxArena.
Sourcepub fn decode_frame<T: DcMixedDecode>(
&mut self,
stub: &DcFrameStub,
context: Option<&SharedValueContext>,
policy: &DcProjectionPolicy,
) -> Result<T>
pub fn decode_frame<T: DcMixedDecode>( &mut self, stub: &DcFrameStub, context: Option<&SharedValueContext>, policy: &DcProjectionPolicy, ) -> Result<T>
Decodes a DcFrameStub into a typed Rust value T using the given
SharedValueContext and DcProjectionPolicy.
Sourcepub fn expand_frame(
&mut self,
stub: &DcFrameStub,
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
) -> Result<NodeId>
pub fn expand_frame( &mut self, stub: &DcFrameStub, arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, ) -> Result<NodeId>
Expands a DcFrameStub into a full CST inside the reusable DcSyntaxArena.
Sourcepub fn parse_document_into_arena(
&mut self,
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
) -> Result<()>
pub fn parse_document_into_arena( &mut self, arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, ) -> Result<()>
Parses all sibling constructs in the active span into arena.
Sourcepub fn parse_document_into_arena_with_resolver(
&mut self,
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
resolver: &dyn SyntaxRuleResolver,
) -> Result<()>
pub fn parse_document_into_arena_with_resolver( &mut self, arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, resolver: &dyn SyntaxRuleResolver, ) -> Result<()>
Parses all sibling constructs in the active span into arena using the
provided SyntaxRuleResolver.
Sourcepub fn parse_node_into_arena(
&mut self,
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
) -> Result<NodeId>
pub fn parse_node_into_arena( &mut self, arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, ) -> Result<NodeId>
Parses the next statement or container at the current cursor into arena.
Sourcepub fn parse_arena(
bytes: &'a [u8],
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
) -> Result<NodeId>
pub fn parse_arena( bytes: &'a [u8], arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, ) -> Result<NodeId>
Parses a single root node from bytes into arena using policy.
Sourcepub fn parse_document_arena_with_resolver(
bytes: &'a [u8],
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
resolver: &dyn SyntaxRuleResolver,
) -> Result<()>
pub fn parse_document_arena_with_resolver( bytes: &'a [u8], arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, resolver: &dyn SyntaxRuleResolver, ) -> Result<()>
Parses all document root nodes from bytes into arena using policy and resolver.
Sourcepub fn parse_document_arena(
bytes: &'a [u8],
arena: &mut DcSyntaxArena<'a>,
policy: &DcProjectionPolicy,
) -> Result<()>
pub fn parse_document_arena( bytes: &'a [u8], arena: &mut DcSyntaxArena<'a>, policy: &DcProjectionPolicy, ) -> Result<()>
Parses all document root nodes from bytes into arena using policy.
Sourcepub fn eval_pattern<'p, 'r: 'p>(
&mut self,
pattern: &'p SyntaxPattern,
ctx: &mut SyntaxEvalContext<'r>,
) -> Result<bool>
pub fn eval_pattern<'p, 'r: 'p>( &mut self, pattern: &'p SyntaxPattern, ctx: &mut SyntaxEvalContext<'r>, ) -> Result<bool>
Evaluates a SyntaxPattern starting at the navigator’s current cursor.
If the pattern matches, advances self.cursor past the matched span and
returns Ok(true). If the pattern does not match, rewinds self.cursor
to its starting offset and returns Ok(false).
Sourcepub fn eval_pattern_tokens<'p, 'r: 'p>(
&mut self,
raw_tokens: &'p [DcShorthand],
ctx: &mut SyntaxEvalContext<'r>,
) -> Result<bool>
pub fn eval_pattern_tokens<'p, 'r: 'p>( &mut self, raw_tokens: &'p [DcShorthand], ctx: &mut SyntaxEvalContext<'r>, ) -> Result<bool>
Evaluates a .Semantic:Pattern &[DcShorthand] token slice from the seed graph,
memoizing the decoded SyntaxPattern per (SeedGraphIndex::instance_id, raw_tokens)
so repeated evaluations execute without per-step token re-decoding or heap allocations.
Sourcepub fn eval_term_single(
&mut self,
term: &SyntaxTerm,
ctx: &mut SyntaxEvalContext<'_>,
) -> Result<bool>
pub fn eval_term_single( &mut self, term: &SyntaxTerm, ctx: &mut SyntaxEvalContext<'_>, ) -> Result<bool>
Evaluates a single SyntaxTerm occurrence starting at the current cursor.
Sourcepub fn validate_document_strict(&mut self) -> Result<()>
pub fn validate_document_strict(&mut self) -> Result<()>
Strictly validates all constructs in the navigator’s active span against the Document Character syntax rules and named-type definitions.
Sourcepub fn validate_document(&mut self, policy: &DcProjectionPolicy) -> Result<()>
pub fn validate_document(&mut self, policy: &DcProjectionPolicy) -> Result<()>
Validates the active span with the same grammar and resource policy used by arena parsing, without retaining document nodes.
Sourcepub fn validate_document_with_resolver(
&mut self,
policy: &DcProjectionPolicy,
resolver: &dyn SyntaxRuleResolver,
) -> Result<()>
pub fn validate_document_with_resolver( &mut self, policy: &DcProjectionPolicy, resolver: &dyn SyntaxRuleResolver, ) -> Result<()>
Validates the active span with the same grammar and resource policy used by arena parsing and the provided resolver, without retaining document nodes.
Sourcepub fn read_tokens_in_span(&mut self, span: DcByteSpan) -> Result<Vec<u128>>
pub fn read_tokens_in_span(&mut self, span: DcByteSpan) -> Result<Vec<u128>>
Reads all raw token global IDs within span (preserving escape tokens).
§Errors
Returns an error if span falls on an invalid DcTF or binary boundary.
Sourcepub const fn is_v1_encoding(&self) -> bool
pub const fn is_v1_encoding(&self) -> bool
Returns true if the navigator is backed by a DcMixed1 (DcUtf) file.
Sourcepub fn char_encoded_len(&self, ch: DcChar) -> u64
pub fn char_encoded_len(&self, ch: DcChar) -> u64
Returns the encoded byte length of ch in the underlying stream’s Dc encoding
(DcUtf for DcMixed1, DcTF for DcMixed2 and in-memory buffers).
Sourcepub fn from_mstr_with_kernel_version(
mstr: &'a DcMstr,
kernel_version: BootstrapKernelVersion,
) -> Self
pub fn from_mstr_with_kernel_version( mstr: &'a DcMstr, kernel_version: BootstrapKernelVersion, ) -> Self
Creates a navigator over an in-memory DcMstr, installing kernel_version
before any leading header/pin inspection (Dc 641) or token decoding occurs.
Sourcepub fn try_from_mstr_with_kernel_version_number(
mstr: &'a DcMstr,
version: u32,
) -> Result<Self>
pub fn try_from_mstr_with_kernel_version_number( mstr: &'a DcMstr, version: u32, ) -> Result<Self>
Validates an explicit bootstrap kernel version number (1 for V1) and creates
a navigator over mstr with that version active before any pin detection or token
decoding runs.
§Errors
Returns an error immediately if version is not a supported bootstrap kernel version.
Sourcepub fn from_mstr_with_policy(
mstr: &'a DcMstr,
policy: &DcProjectionPolicy,
) -> Self
pub fn from_mstr_with_policy( mstr: &'a DcMstr, policy: &DcProjectionPolicy, ) -> Self
Creates a navigator over an in-memory DcMstr using policy.kernel_version
and policy.unpinned_fallback_most_recent_node_id before any leading header/pin
inspection (Dc 641) or token decoding occurs.
Sourcepub fn from_dc_str(text: &'a DcStr) -> Self
pub fn from_dc_str(text: &'a DcStr) -> Self
Creates a navigator over an in-memory DcStr.
Sourcepub fn from_dc_str_with_kernel_version(
text: &'a DcStr,
kernel_version: BootstrapKernelVersion,
) -> Self
pub fn from_dc_str_with_kernel_version( text: &'a DcStr, kernel_version: BootstrapKernelVersion, ) -> Self
Creates a navigator over an in-memory DcStr, installing kernel_version
before any leading header/pin inspection (Dc 641) or token decoding occurs.
Sourcepub fn try_from_dc_str_with_kernel_version_number(
text: &'a DcStr,
version: u32,
) -> Result<Self>
pub fn try_from_dc_str_with_kernel_version_number( text: &'a DcStr, version: u32, ) -> Result<Self>
Validates an explicit bootstrap kernel version number (1 for V1) and creates
a navigator over text with that version active before any pin detection or token
decoding runs.
§Errors
Returns an error immediately if version is not a supported bootstrap kernel version.
Sourcepub fn from_dc_str_with_policy(
text: &'a DcStr,
policy: &DcProjectionPolicy,
) -> Self
pub fn from_dc_str_with_policy( text: &'a DcStr, policy: &DcProjectionPolicy, ) -> Self
Creates a navigator over an in-memory DcStr using policy.kernel_version
and policy.unpinned_fallback_most_recent_node_id before any leading header/pin
inspection (Dc 641) or token decoding occurs.
Returns the shared crate::converters::wasm::SharedWasmTaskQuota debited across
WASM stream splices and helper evaluations on this navigator.
Replaces the shared crate::converters::wasm::SharedWasmTaskQuota used for
WASM stream splices and helper evaluations on this navigator.
Builder-style method attaching a shared crate::converters::wasm::SharedWasmTaskQuota.
Sourcepub const fn kernel_version(&self) -> BootstrapKernelVersion
pub const fn kernel_version(&self) -> BootstrapKernelVersion
Returns the active BootstrapKernelVersion governing physical codecs,
SeedGraphIndex triple resolution, .Semantic:Pattern operators, and Dc-WASM lowering.
Sourcepub fn set_kernel_version(&mut self, version: BootstrapKernelVersion)
pub fn set_kernel_version(&mut self, version: BootstrapKernelVersion)
Sets the BootstrapKernelVersion for this navigator before document interpretation.
Sourcepub fn select_bootstrap_kernel_version(
&mut self,
version: u32,
) -> Result<BootstrapKernelVersion>
pub fn select_bootstrap_kernel_version( &mut self, version: u32, ) -> Result<BootstrapKernelVersion>
Selects and validates an explicit bootstrap kernel version number (1 for V1)
during bootstrap before any document or graph interpretation that depends on it.
§Errors
Returns an error if version is not a supported bootstrap kernel version.
Sourcepub const fn document_most_recent_node_id(&self) -> Option<u128>
pub const fn document_most_recent_node_id(&self) -> Option<u128>
Returns the System-block most recent node ID (Dc 641 "Global graph system block most recent node ID at time of document creation")
active in the current scope, if any.
Sourcepub const fn pin_provenance(&self) -> DcPinProvenance
pub const fn pin_provenance(&self) -> DcPinProvenance
Returns the provenance of the current scope’s System-block snapshot resolution policy.
Sourcepub fn diagnostics(&self) -> &[SyntaxDiagnostic]
pub fn diagnostics(&self) -> &[SyntaxDiagnostic]
Returns parse and validation diagnostics recorded on this navigator.
Sourcepub fn effective_resolver(&self) -> Arc<DatasetRuleResolver>
pub fn effective_resolver(&self) -> Arc<DatasetRuleResolver>
Returns the syntax rule resolver pinned for this document (via Dc 641 or explicit override),
or the process-wide default_syntax_resolver() when unpinned.
Sourcepub fn set_pinned_resolver(
&mut self,
resolver: Option<Arc<DatasetRuleResolver>>,
)
pub fn set_pinned_resolver( &mut self, resolver: Option<Arc<DatasetRuleResolver>>, )
Overrides the pinned syntax rule resolver for this navigator.
Sourcepub fn peek_token(&mut self) -> Result<Option<DcChar>>
pub fn peek_token(&mut self) -> Result<Option<DcChar>>
Peeks the next token in the stream without advancing the cursor.
§Errors
Returns an error if reading from the stream fails.
Sourcepub fn read_next_token(&mut self) -> Result<Option<DcChar>>
pub fn read_next_token(&mut self) -> Result<Option<DcChar>>
Consumes and returns the next token from the spliced buffer or backend stream.
§Errors
Returns an error if reading from the stream fails.
Sourcepub fn push_spliced_tokens<I: IntoIterator<Item = DcChar>>(&mut self, tokens: I)
pub fn push_spliced_tokens<I: IntoIterator<Item = DcChar>>(&mut self, tokens: I)
Splices tokens into the navigator’s append-only stream buffer.
Sourcepub fn spliced_tokens(&self) -> &[DcChar]
pub fn spliced_tokens(&self) -> &[DcChar]
Returns the active slice of spliced tokens remaining to be consumed.
Sourcepub fn splice_stream_invocation(
&mut self,
evaluator: &dyn DcExpressionEvaluator,
resolver: &dyn SyntaxRuleResolver,
_policy: &DcProjectionPolicy,
) -> Result<bool>
pub fn splice_stream_invocation( &mut self, evaluator: &dyn DcExpressionEvaluator, resolver: &dyn SyntaxRuleResolver, _policy: &DcProjectionPolicy, ) -> Result<bool>
Evaluates a stream-splicing invocation at the current cursor via evaluator,
advances the cursor past the call, and pushes emitted tokens into spliced_tokens.
Sourcepub const fn save_checkpoint(&self) -> NavigatorCheckpoint
pub const fn save_checkpoint(&self) -> NavigatorCheckpoint
Saves the current cursor and spliced token slice state into a zero-copy checkpoint.
Sourcepub const fn restore_checkpoint(&mut self, checkpoint: NavigatorCheckpoint)
pub const fn restore_checkpoint(&mut self, checkpoint: NavigatorCheckpoint)
Restores a previously saved checkpoint in O(1) without heap allocation.
Sourcepub fn from_dcmm_file(file: File, base_offset: u64) -> Result<Self>
pub fn from_dcmm_file(file: File, base_offset: u64) -> Result<Self>
Creates a streaming and seeking navigator over an on-disk .dcmm file
starting at base_offset (e.g. 0 for a standalone .dcmm file, or 8
for a .cscjournal after its 8-byte journal magic).
Validates the 21-byte .dcmm magic/UUID header once at base_offset
without reading the rest of the file into memory.
Sourcepub fn from_dcmm_file_with_kernel_version(
file: File,
base_offset: u64,
kernel_version: BootstrapKernelVersion,
) -> Result<Self>
pub fn from_dcmm_file_with_kernel_version( file: File, base_offset: u64, kernel_version: BootstrapKernelVersion, ) -> Result<Self>
Creates a streaming and seeking navigator over an on-disk .dcmm file
starting at base_offset, installing kernel_version before any leading
header/pin inspection (Dc 641) or token decoding occurs.
Sourcepub fn try_from_dcmm_file_with_kernel_version_number(
file: File,
base_offset: u64,
version: u32,
) -> Result<Self>
pub fn try_from_dcmm_file_with_kernel_version_number( file: File, base_offset: u64, version: u32, ) -> Result<Self>
Validates an explicit bootstrap kernel version number (1 for V1) and creates
a navigator over an on-disk .dcmm file starting at base_offset with that version
active before any pin detection or token decoding runs.
§Errors
Returns an error immediately if version is not a supported bootstrap kernel version
or if the .dcmm file header is invalid.
Sourcepub fn from_dcmm_file_with_policy(
file: File,
base_offset: u64,
policy: &DcProjectionPolicy,
) -> Result<Self>
pub fn from_dcmm_file_with_policy( file: File, base_offset: u64, policy: &DcProjectionPolicy, ) -> Result<Self>
Creates a streaming and seeking navigator over an on-disk .dcmm file
starting at base_offset using policy.kernel_version and
policy.unpinned_fallback_most_recent_node_id before any leading header/pin
inspection (Dc 641) or token decoding occurs.
Sourcepub const fn active_span(&self) -> DcByteSpan
pub const fn active_span(&self) -> DcByteSpan
Returns the active level’s byte span bounds.
Sourcepub fn seek_to_offset(&mut self, offset: u64) -> Result<()>
pub fn seek_to_offset(&mut self, offset: u64) -> Result<()>
Seeks the cursor to an arbitrary byte offset within the active level span.
Sourcepub fn seek_to_stub(&mut self, stub: &DcFrameStub) -> Result<()>
pub fn seek_to_stub(&mut self, stub: &DcFrameStub) -> Result<()>
Seeks the cursor to the start of a previously observed DcFrameStub.
Sourcepub fn enter_frame(&mut self, stub: &DcFrameStub) -> Result<()>
pub fn enter_frame(&mut self, stub: &DcFrameStub) -> Result<()>
Enters the interior of a container DcFrameStub, restricting subsequent
Self::next_sibling_stub calls to the container’s children until
Self::exit_frame is called.
Sourcepub fn exit_frame(&mut self) -> Result<()>
pub fn exit_frame(&mut self) -> Result<()>
Exits the current container level and restores the enclosing level’s bounds, positioning the cursor at the end of the exited container.
Sourcepub fn read_span_bytes(&mut self, span: DcByteSpan) -> Result<Cow<'a, [u8]>>
pub fn read_span_bytes(&mut self, span: DcByteSpan) -> Result<Cow<'a, [u8]>>
Reads a raw byte range from the underlying source into a Vec<u8>.
Sourcepub fn read_span_as_mstring(&mut self, span: DcByteSpan) -> Result<DcMstring>
pub fn read_span_as_mstring(&mut self, span: DcByteSpan) -> Result<DcMstring>
Reads a raw byte range from the underlying source and wraps it in a
validated DcMstring.
Sourcepub fn next_sibling_stub(
&mut self,
policy: &DcProjectionPolicy,
) -> Result<Option<DcFrameStub>>
pub fn next_sibling_stub( &mut self, policy: &DcProjectionPolicy, ) -> Result<Option<DcFrameStub>>
Steps across the next sibling statement or container at the current level without allocating an AST for its children.
When backed by a seekable file, binary regions (203..204) are skipped in
$O(1)$ via SeekFrom::Current, and checksummed sections (543..544 + 545)
are verified incrementally.
Sourcepub fn next_sibling_stub_with_resolver(
&mut self,
policy: &DcProjectionPolicy,
resolver: &dyn SyntaxRuleResolver,
) -> Result<Option<DcFrameStub>>
pub fn next_sibling_stub_with_resolver( &mut self, policy: &DcProjectionPolicy, resolver: &dyn SyntaxRuleResolver, ) -> Result<Option<DcFrameStub>>
Advances to and returns the next sibling DcFrameStub using the
specified SyntaxRuleResolver.
Trait Implementations§
Source§fn materialize_binary<'a>(
&mut self,
payload: &BinaryPayloadRef<'a>,
) -> Result<Cow<'a, [u8]>>
fn materialize_binary<'a>( &mut self, payload: &BinaryPayloadRef<'a>, ) -> Result<Cow<'a, [u8]>>
payload, reading from the backing stream if lazy.Auto Trait Implementations§
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_into(self) -> U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§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();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§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();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§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();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§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();§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>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§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);