Skip to main content

TsExpr

Enum TsExpr 

Source
pub enum TsExpr {
Show 18 variants Ident(String), Member { object: Box<TsExpr>, property: String, }, OptionalMember { object: Box<TsExpr>, property: String, }, Index { object: Box<TsExpr>, index: Box<TsExpr>, }, OptionalIndex { object: Box<TsExpr>, index: Box<TsExpr>, }, Arrow { params: Vec<TsParam>, is_async: bool, generics: Vec<String>, return_type: Option<TsType>, body: Box<TsArrowBody>, }, Call { callee: Box<TsExpr>, args: Vec<TsExpr>, }, New { callee: Box<TsExpr>, args: Vec<TsExpr>, }, Object { entries: Vec<TsObjectEntry>, multiline: bool, }, Array { items: Vec<TsExpr>, multiline: bool, }, TemplateLit { parts: Vec<String>, exprs: Vec<TsExpr>, }, Await(Box<TsExpr>), As { expr: Box<TsExpr>, ty: TsType, }, Unary { op: TsUnaryOp, expr: Box<TsExpr>, }, Binary { op: TsBinaryOp, left: Box<TsExpr>, right: Box<TsExpr>, }, Conditional { test: Box<TsExpr>, consequent: Box<TsExpr>, alternate: Box<TsExpr>, }, Paren(Box<TsExpr>), Lit(TsLit),
}
Expand description

An expression. Only the shapes events_fanout.rs concretely uses (Decision B) — not the reference sketch’s full TsExpr list (Arrow, Cond, TemplateLit, Spread are all unused in the grounding file and deliberately not built here). Arc C slice 3 (#1321, workers.rs) adds Arrow, OptionalMember/OptionalIndex (Decision A, gaps 3/4) — this slice’s own real, grounded needs.

Variants§

§

Ident(String)

§

Member

object.property.

Fields

§object: Box<TsExpr>
§property: String
§

OptionalMember

object?.property — the optional-chaining form of TsExpr::Member. A distinct variant, not an optional: bool flag on Member itself (#1321’s own Decision A, gap 4, left the mechanism to the implementation): a flag would touch every one of Member’s already-many real call sites (events_fanout.rs, this crate’s own printer tests) that never need one, where a separate variant touches none of them — narrower, matching this track’s own repeated “smallest correct scope” judgment. workers.rs’s own secret-probe idiom (emit_websocket_upgrade/emit_http_wrapper/ emit_secret_lookup, three identical real sites) is the only grounding.

Fields

§object: Box<TsExpr>
§property: String
§

Index

object[index].

Fields

§object: Box<TsExpr>
§index: Box<TsExpr>
§

OptionalIndex

object?.[index] — the optional-chaining form of TsExpr::Index, the same real grounding and the same “separate variant, not a flag” reasoning as TsExpr::OptionalMember.

Fields

§object: Box<TsExpr>
§index: Box<TsExpr>
§

Arrow

(params) => body (is_async: false) or async (params) => body (is_async: true) — an arrow function, expression- or block-bodied (see TsArrowBody). is_async added by #1327: emit_composition_root’s own __eventsDispatch closure (async (events: Array<...>) => {...}) is the first real Arrow site that’s async — mirrors TsDecl::Function’s own is_async field (#1325), added for the same reason. generics/return_type added by #1339: emit_sum_type’s own generic payload-constructor arrows (<T>(name: T): Sum<T> => (...)) need both — bare generic names only (empty for every non-generic site, the overwhelming majority), matching TsObjectEntry::Method.generics’s own (#1337) identical convention; return_type mirrors TsDecl::Function.return_type’s own existing Option<TsType> shape — a real gap the accepted proposal’s own grounding named generics for but missed: every one of this file’s own real generic-payload arrows carries an explicit return-type annotation the arrow itself owns (: {name}{params}), not something the body’s own type alone determines.

body’s type became TsArrowBody (#1435, Arc E slice 1): from P7.8 through #1434 this field was a bare Box<TsExpr> — expression- bodied only, “extend narrowly” (the same posture TsBinaryOp takes for its own operator table), since every real site up to and including #1339’s generic payload-constructor arrows had an expression body. serialisation.rs’s serialise_field_expr_wire (bynk-emit) is the first real site that doesn’t: its Float non-finite guard is a genuine statement-bodied IIFE (((v: number) => { if (!Number.isFinite(v)) throw new Error(...); return v as JsonValue; })(value)), not reducible to one expression. Widening the existing field (TsArrowBody::Expr(Box<TsExpr>) | TsArrowBody::Block(Vec<TsStmt>)) rather than adding a second sibling TsExpr variant matches this file’s own repeated “extend the existing variant when every real site still needs the same node kind, only the body shape differs” precedent (TsObjectEntry::Method.inline, #1337) — every prior Arrow construction site across the workspace wraps its already-correct expression body in TsArrowBody::Expr(..), a mechanical change with no behavior difference.

Fields

§params: Vec<TsParam>
§is_async: bool
§generics: Vec<String>
§return_type: Option<TsType>
§

Call

Fields

§callee: Box<TsExpr>
§args: Vec<TsExpr>
§

New

Fields

§callee: Box<TsExpr>
§args: Vec<TsExpr>
§

Object

A value object literal, e.g. { status: 204 } — comma-separated. multiline: false (the ordinary case, via TsExpr::object) always prints on one line, matching TsType::Object’s own (semicolon-separated) single-line convention for the type-position shape. multiline: true (via TsExpr::multiline_object) is a real, grounded gap found implementing Arc C’s first slice (#1317): events_fanout.rs’s own __eventRoutes table is a top-level const initializer with one entry per line, each with its own trailing comma, closing brace at the statement’s own indent — TypeScript’s ordinary multi-line object-literal convention, which nothing in this crate could represent before this addition. Only statement/declaration-level renderers (which already carry depth) can render this correctly — printer.rs’s own render_stmt_level_ expr, and (#1355) render_multiline_object_entry‘s own Prop arm, for a multiline: true object nested one level inside ANOTHER multiline object as one of its own entries’ values — emit_messages_bundle’s own real doubly-nested { locale: { code: expr, ... }, ... } table. A multiline: true object nested any OTHER way (an array element, a call argument, a Prop’s value inside a non-multiline object, …) still renders via the ordinary depth-unaware render_expr recursion, which cannot honour multiline — not reachable from any real bynk-emit call site today, but worth knowing before nesting one that way.

Fields

§multiline: bool
§

Array

An array literal, e.g. [{ binding: "x", service: "y" }]. multiline: false (the ordinary case, via TsExpr::array) always prints on one line, comma-separated — every real site before this slice. multiline: true (via TsExpr::multiline_array) is #1325’s own real gap: emit_test_main’s own modules array (one { name, run } entry per test, one per line, each with its own trailing comma, closing ] at the statement’s own indent) — the exact same shape TsExpr::Object’s own multiline field already represents for object literals, just for an array. Same reachability boundary as Object’s own multiline field (see its own doc, updated by #1355): render_stmt_level_expr and render_multiline_object_ entry’s own Prop arm both honour it; nested any other way, a multiline: true array falls back to single-line via the ordinary depth-unaware render_expr recursion.

Fields

§items: Vec<TsExpr>
§multiline: bool
§

TemplateLit

`text${expr}more text` — a template literal. parts.len() is always exprs.len() + 1 (parts[0] before the first substitution, parts[i+1] after exprs[i], …). #1325’s own real, first grounding for this shape (bynk-ts’s own module doc named TemplateLit explicitly “unused in the grounding file” until now): emit_test_main’s own `${m.name}:`/`${passed} passed, ${failed} failed.` lines.

parts are printed verbatim — the printer applies no escaping of its own. The same “the field is already a raw-text slot” reasoning TsDecl::Import’s own names field doc already uses, not a new pattern: emit_test_main’s own two real ✓/✗ substitution lines embed a literal / JS unicode escape as pre-formed ASCII text (six literal characters, not the actual glyph) — an escaper mirroring TsLit::Str’s own (which escapes every \ it sees) would double that literal backslash into \\u2713, corrupting the exact byte-golden output this slice must match. Every real part in emit_test_main is static, compiler-authored text (never Bynk user data), so there is no real content this boundary loses safety on today — a future caller passing untrusted/dynamic text into parts is responsible for pre-escaping backtick/${/\ itself before constructing one.

Fields

§parts: Vec<String>
§exprs: Vec<TsExpr>
§

Await(Box<TsExpr>)

§

As

expr as ty.

Fields

§expr: Box<TsExpr>
§

Unary

Fields

§expr: Box<TsExpr>
§

Binary

Fields

§left: Box<TsExpr>
§right: Box<TsExpr>
§

Conditional

test ? consequent : alternate — #1323’s own real gap: method === "HEAD" ? headResponse(__response) : __response (once per GET route) and method === "OPTIONS" ? 204 : 405 (the method-fallthrough path). The lowest-precedence expression form after Arrow — needs the same parenthesization-rule coverage Arrow got in review of #1322 (needs_parens_as_operand/render_binary_operand/As’s own local rule), added proactively in this same slice rather than left for a review round to re-find.

Fields

§test: Box<TsExpr>
§consequent: Box<TsExpr>
§alternate: Box<TsExpr>
§

Paren(Box<TsExpr>)

An explicit, printer-preserved parenthesization — distinct from every other variant’s own precedence-derived parens (render_operand/ render_binary_operand), which the printer adds or omits based on what the wrapped expression is. Paren instead always prints (<inner>) regardless of inner’s own shape or precedence. #1323’s own real, narrow need: workers_entry.rs’s CORS-preflight guard wraps its own path-match condition in unconditional parens (&& ({cond})) even when cond reduces to a single equality check with no operator lower-precedence than the outer && — a real case the precedence-derived rules correctly do not parenthesize (they’re answering “is this needed for correctness”, not “did the source always write parens here”). Not a general escape hatch: every other real site in this file’s own content still goes through the ordinary precedence machinery unchanged.

§

Lit(TsLit)

Implementations§

Source§

impl TsExpr

Source

pub fn object(entries: Vec<(String, TsExpr)>) -> Self

The ordinary, single-line object literal, Prop-only — every entry is key: value. events_fanout.rs’s own entries (and this crate’s own printer tests) are all this shape; kept taking a plain Vec<(String, TsExpr)> rather than Vec<TsObjectEntry> so none of those existing call sites needed to change when TsObjectEntry was added (#1321) — see TsExpr::object_entries for the mixed-entry form workers.rs itself needs (shorthand/spread/method entries).

Source

pub fn multiline_object(entries: Vec<(String, TsExpr)>) -> Self

One entry per line, each with its own trailing comma — see TsExpr::Object’s own doc for the real shape and the depth-awareness this needs at the print site. Prop-only, the same convenience TsExpr::object’s own doc explains.

Source

pub fn object_entries(entries: Vec<TsObjectEntry>) -> Self

The single-line object literal, taking TsObjectEntry directly — for a mixed entry list (shorthand/spread/method alongside Prop), which TsExpr::object’s own Vec<(String, TsExpr)> convenience can’t represent. #1321’s own real grounding: workers.rs’s local capability-provider deps object mixes shorthand names ({ cap1, cap2 }) with explicit key: value entries (__exec: exec) in one literal.

Source

pub fn multiline_object_entries(entries: Vec<TsObjectEntry>) -> Self

TsExpr::multiline_object’s own TsObjectEntry sibling — #1321’s own real grounding: workers.rs’s compose-returned surface object is one shorthand-async-Method entry per wrapper, one per line.

Source

pub fn array(items: Vec<TsExpr>) -> Self

The ordinary, single-line array literal — every real site before #1325.

Source

pub fn multiline_array(items: Vec<TsExpr>) -> Self

One entry per line, each with its own trailing comma — see TsExpr::Array’s own doc for the real shape and the depth-awareness this needs at the print site. #1325’s own real grounding: emit_test_main’s own modules array.

Source

pub fn template_lit(parts: Vec<String>, exprs: Vec<TsExpr>) -> Self

A template literal — see TsExpr::TemplateLit’s own doc for the real shape and its no-escaping boundary. The sole caller-facing invariant (parts.len() == exprs.len() + 1) is asserted here rather than left to render_expr’s own parts-driven loop, which would otherwise silently drop trailing exprs on a malformed tree instead of failing loudly (review of #1326, finding 1).

Trait Implementations§

Source§

impl Clone for TsExpr

Source§

fn clone(&self) -> TsExpr

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 TsExpr

Source§

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

Formats the value using the given formatter. Read more

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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

§

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
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.