DatasetRuleResolver

Struct DatasetRuleResolver 

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

In-memory resolver caching syntax rules, named types, and script mappings.

Implementations§

Source§

impl DatasetRuleResolver

Source

pub fn load_from_embedded_dataset() -> Result<DatasetRuleResolver, Error>

Builds a resolver by indexing the CSV fixture dataset in src/formats/dcdata/data-src/.

Used by the consistency test verifying that the seed graph syntax resolver is up to date with the CSV dataset.

§Errors

Returns an error if the fixture dataset is missing or invalid.

Source

pub fn load_from_dataset( dc_defns: &[DcDefn], format_defns: &[DcDefn], named_types_csv: Option<&[u8]>, ) -> Result<DatasetRuleResolver, Error>

Builds a resolver by indexing syntax rules directly from parsed dataset definitions.

This is the CSV-driven authoritative indexing path used by consistency tests verifying that the seed graph syntax resolver matches the CSV dataset. dc_defns must be sorted by long ID so delimiter precedence is deterministic (matching lookup::get_all_dc_defns).

§Errors

Returns an error with CSV row and named type context when a named type record or its grammar is invalid.

Source§

impl DatasetRuleResolver

Source

pub fn new() -> DatasetRuleResolver

Creates an empty resolver instance.

Source

pub fn set_seed_graph(&mut self, seed_graph: Arc<SeedGraphIndex>)

Binds a crate::seed_graph::SeedGraphIndex snapshot to this resolver.

Source

pub fn add_subtype(&mut self, sub_token: u128, super_token: u128)

Registers a direct subtype relationship (sub_token is a subtype of super_token).

Source

pub fn add_rule(&mut self, target: CharTarget, rule: DcSyntaxRule)

Registers a syntax rule for a character target.

Source

pub fn add_named_type(&mut self, name: String, pattern: SyntaxPattern)

Registers a pattern definition for a named type.

Source

pub fn add_script_char(&mut self, script: String, token: u128)

Registers a character token under a script name.

Source

pub fn register_closing_delimiter( &mut self, closer_token: u128, opener: CharTarget, )

Registers a delimiter token as closing an opener target.

Source

pub fn register_equivalence(&mut self, alias_token: u128, canonical_token: u128)

Registers a semantic equivalence mapping alias_token to canonical_token.

Source

pub fn register_deprecated( &mut self, target: CharTarget, preferred: Option<CharTarget>, )

Registers a deprecated target and its optional preferred replacement.

Source

pub fn rebuild_framing_and_wrapper_tables(&mut self)

Rebuilds the cached framing-shape and special-wrapper lookup tables from the currently registered rules, delimiters, and equivalences.

Source

pub fn from_seed_graph_arc( index: Arc<SeedGraphIndex>, ) -> Result<DatasetRuleResolver, Error>

Builds a resolver directly from a shared runtime SeedGraphIndex (data/graph/85899_34592.ctbnbdl) without cloning it.

Source

pub fn from_seed_graph( index: &SeedGraphIndex, ) -> Result<DatasetRuleResolver, Error>

Builds a resolver directly from the runtime SeedGraphIndex (data/graph/85899_34592.ctbnbdl).

Source

pub fn load_from_seed_graph() -> Result<DatasetRuleResolver, Error>

Loads a DatasetRuleResolver from the process-wide shared SeedGraphIndex (data/graph/85899_34592.ctbnbdl).

Source

pub fn load_at_most_recent( most_recent_node_id: u128, ) -> Result<DatasetRuleResolver, Error>

Loads a DatasetRuleResolver reflecting the System-block graph state as of most_recent_node_id (Dc 641 "Global graph system block most recent node ID at time of document creation").

Source§

impl DatasetRuleResolver

Source

pub fn load() -> DatasetRuleResolver

Loads the authoritative resolver state from the bundled runtime seed graph (data/graph/85899_34592.ctbnbdl via SeedGraphIndex::shared()).

Trait Implementations§

Source§

impl Clone for DatasetRuleResolver

Source§

fn clone(&self) -> DatasetRuleResolver

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DatasetRuleResolver

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for DatasetRuleResolver

Source§

fn default() -> DatasetRuleResolver

Returns the “default value” for a type. Read more
Source§

impl SyntaxRuleResolver for DatasetRuleResolver

Source§

fn seed_graph(&self) -> Option<&SeedGraphIndex>

Returns the underlying SeedGraphIndex when backed by the System-block seed graph.
Source§

fn is_subtype_of(&self, sub_token: u128, super_token: u128) -> bool

Returns true if sub_token is equivalent to or a transitive subtype (Dc 587) of super_token.
Source§

fn canonical_token(&self, token: u128) -> u128

Returns the canonical token in this token’s equivalence class, or token itself if no <equiv> alias is defined.
Source§

fn unicode_text_mapping(&self, token: u128, approximate: bool) -> Option<&str>

Returns Unicode text derived from declared equivalences and, when requested, approximations. Unresolved or cyclic mappings return None.
Source§

fn equivalent_short_dc_for_unicode( &self, tokens: &[u128], ) -> Option<(u128, usize)>

Matches the longest prefix of tokens that has an exact (<equiv>) mapping from an already-assigned short Dc (< 641), returning (short_dc_global_id, consumed_token_count).
Source§

fn is_equivalent_to(&self, token: u128, canonical: u128) -> bool

Checks semantic token equivalence, independently of grammar types.
Source§

fn resolve_rule(&self, target: &CharTarget) -> Option<&DcSyntaxRule>

Resolves the syntax rule associated with a character or format target.
Source§

fn resolve_named_type(&self, name: &str) -> Option<&SyntaxPattern>

Resolves the pattern definition for a named syntactic construct.
Source§

fn matches_script(&self, script_name: &str, token: u128) -> bool

Checks whether a character token belongs to a designated script.
Source§

fn may_match_any_script(&self, token: u128) -> bool

Fast filter returning false when token is known not to belong to any script.
Source§

fn has_script(&self, script_name: &str) -> bool

Checks whether a designated script name exists in the dataset.
Source§

fn matches_named_type_starter(&self, name: &str, token: u128) -> bool

Returns true if token can appear as the leading token of the named construct name.
Source§

fn closing_opener_for(&self, token: u128) -> Option<&CharTarget>

Returns the opener target if this character token is a closing delimiter.
Source§

fn closer_for_opener(&self, opener: &CharTarget) -> Option<u128>

Returns the closing token for an opener target if known.
Source§

fn is_deprecated(&self, target: &CharTarget) -> bool

Returns true if the given character or format target is marked deprecated in the dataset.
Source§

fn preferred_replacement(&self, target: &CharTarget) -> Option<&CharTarget>

Returns the preferred replacement target (<prefer>...) for a deprecated target, if any.
Source§

fn container_header_elements(&self, opener: &CharTarget) -> &[SyntaxElement]

Returns the leading header syntax elements between ~ and the container body/closer (for example, [number $length]? [type] for 310, or [format] for 511).
Source§

fn trailing_after_closer(&self, opener: &CharTarget) -> &[SyntaxElement]

Returns any syntax elements required immediately after a container’s closing delimiter (for example, [545:] after 544 in 543’s rule :~ [^544]+ 544 [545:]).
Source§

fn resolve_infix_rule( &self, op_token: u128, ) -> Option<(&[SyntaxElement], &[SyntaxElement])>

Resolves an infix operator rule (lhs_elements, rhs_elements) where ~ is preceded by a left-hand operand (for example, Dc 269: :[identifier $ident] ~ [value $val]).
Source§

fn is_opaque_container(&self, opener_token: u128) -> bool

Returns true if the container opened by opener_token is a lexical/opaque payload container (such as numbers, binary encapsulation, comments, literals, type definitions, or identifiers) whose interior tokens are not recursively parsed as child statements.
Source§

fn framing_shape(&self, token: u128) -> FramingShape

Returns the physical framing shape classification for token.
Source§

fn is_special_wrapper_token(&self, token: u128) -> bool

Returns true if token is a wrapper construct (OptionalPresent, OptionalAbsent, or is_representation_set) handled transparently by pattern evaluation.
Source§

fn is_splice_trigger_token(&self, token: u128) -> bool

Returns true if token emits into the evaluated stream.
Source§

fn is_plain_atom_dc(&self, token: u128) -> bool

Returns true if token matches the single-token branch of [atom_dc] (i.e. is not in the negated delimiter/operator exclusion set of atom_dc).
Source§

fn token_fills_role(&self, token: u128, role: DcRole) -> bool

Checks whether token fills the designated syntactic or semantic role.
Source§

fn resolve_rule_tokens(&self, target: &CharTarget) -> Option<&[DcShorthand]>

Resolves the raw .Semantic:Pattern token sequence (Dc 594 "Syntax rule") for target directly from the seed graph without constructing a Rust SyntaxPattern AST.
Source§

fn resolve_named_type_tokens(&self, name: &str) -> Option<&[DcShorthand]>

Resolves the raw .Semantic:Pattern token sequence (Dc 594 "Syntax rule") for a named construct directly from the seed graph without constructing a Rust SyntaxPattern AST.
Source§

fn resolve_wasm_definition_tokens(&self, token: u128) -> Option<&[DcShorthand]>

Resolves any active .WASM program (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program") or wasm_routine definition attached to token (or its canonical equivalent) in the seed graph.
Source§

fn resolve_wasm_definition_tokens_in_context( &self, token: u128, context_tokens: &[DcShorthand], ) -> Option<&[DcShorthand]>

Resolves any active context-scoped (Dc 646 "In context of") .WASM program attached to token (or its canonical equivalent) matching context_tokens in the seed graph.
Source§

fn format_rule_payload_arity(&self, fid: FormatId) -> Option<usize>

Returns the number of payload elements (excluding ~) in a format’s sequence syntax rule.
Source§

fn resolve_named_type_with_arg( &self, name: &str, arg: Option<&SubtypeConstraint>, ) -> Option<SyntaxPattern>

Resolves the pattern definition for a named construct with macro arguments substituted.
Source§

fn base64_digit_value(&self, token: u128) -> Option<u8>

Returns the Base64 numeral digit value (0..=63) or padding sentinel (64) if token (or its canonical equivalent) represents a Base64 encapsulation character.
Source§

fn is_representation_set(&self, token: u128) -> bool

Classifies full and partial alternative-representation wrappers.
Source§

fn is_representation_header_or_separator(&self, token: u128) -> bool

Classifies list headers and separators in alternative representations.
Source§

fn is_assignment_construct(&self, token: u128) -> bool

Returns true if token is an assignment construct (DcRole::LangAssign, an infix assignment operator, or a syntax rule whose action is lang.assign).
Source§

fn token_satisfies_type( &self, tok: u128, req_name: &str, req_subtype: Option<&SubtypeConstraint>, ) -> bool

Checks whether a single type/format token tok satisfies the type requirement (req_name, req_subtype).
Source§

fn resolve_list_element_term( &self, subtype: Option<&SubtypeConstraint>, ) -> Option<SyntaxTerm>

Resolves the element SyntaxTerm for a [list:<subtype>] constraint.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

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

§

fn exact_from(value: T) -> U

§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

§

fn exact_into(self) -> U

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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
§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

§

fn overflowing_into(self) -> (U, bool)

§

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

§

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 primary(&self) -> Painted<&T>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 bold(&self) -> Painted<&T>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 mask(&self) -> Painted<&T>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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);
§

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

Create a new [Painted] with a default [Style]. Read more
§

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

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

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

§

fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

§

fn saturating_into(self) -> U

§

impl<T> ToDebugString for T
where T: Debug,

§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

§

fn wrapping_into(self) -> U

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,