DcWasmSession

Struct DcWasmSession 

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

Pure-compute WebAssembly execution state machine (step() -> StatusCode) backed by either tinywasm (with portable bytecode compute-quota instrumentation) or a bit-for-bit equivalent Guix-style compiled safe-Rust substitute.

Owns a persistent worker thread whose call stack, locals, linear memory, tables, and globals survive across step() calls and mid-step compute-quota pauses without re-executing earlier instructions.

Implementations§

Source§

impl DcWasmSession

Source

pub fn from_wasm_bytes( wasm_bytes: &[u8], initial_input: &DcMstr, most_recent_node_id: Option<u128>, ) -> Result<Self>

Instantiates a pure-compute DcWasmSession from compiled .wasm module bytes, loading initial_input and most_recent_node_id (Dc 641) into linear memory using DcWasmResourceLimits::default().

§Errors

Returns an error if parsing, instrumenting, or instantiating the module fails, if the module exports neither "step" nor "main", or if writing the initial input into linear memory fails.

Source

pub fn from_wasm_bytes_with_limits( wasm_bytes: &[u8], initial_input: &DcMstr, most_recent_node_id: Option<u128>, resource_limits: DcWasmResourceLimits, ) -> Result<Self>

Instantiates a pure-compute DcWasmSession from compiled .wasm module bytes with explicit DcWasmResourceLimits using DcWasmExecutionBackend::Auto.

§Errors

Returns an error if parsing, instrumenting, or instantiating the module fails, if initial memory exceeds resource_limits.max_memory_pages, if the module exports neither "step" nor "main", or if writing the initial input into linear memory fails.

Source

pub fn from_wasm_bytes_with_limits_and_backend( wasm_bytes: &[u8], initial_input: &DcMstr, most_recent_node_id: Option<u128>, resource_limits: DcWasmResourceLimits, backend: DcWasmExecutionBackend, ) -> Result<Self>

Instantiates a pure-compute DcWasmSession from compiled .wasm module bytes with explicit DcWasmResourceLimits and DcWasmExecutionBackend.

§Errors

Returns an error if parsing, instrumenting, or instantiating the module fails, if initial memory/tables exceed resource_limits, if the module exports neither "step" nor "main", or if writing the initial input into linear memory fails.

Source

pub fn from_substitute_descriptor_with_limits( desc: WasmSubstituteDescriptor, initial_input: &DcMstr, most_recent_node_id: Option<u128>, resource_limits: DcWasmResourceLimits, ) -> Result<Self>

Instantiates a DcWasmSession directly from a pre-resolved native [WasmSubstituteDescriptor], skipping WebAssembly binary compilation and hashing when the graph revision closure already matches a linked substitute.

§Errors

Returns an error if initial memory or table counts exceed resource_limits, if the start section traps, or if writing initial_input into memory fails.

Source

pub fn from_dc_wasm( wasm_doc: &DcMstr, initial_input: &DcMstr, most_recent_node_id: Option<u128>, ) -> Result<Self>

Assembles a Dc-WASM document (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program" or wasm_routine) using the default syntax resolver and instantiates a DcWasmSession.

§Errors

Returns an error if assembling or instantiating the Dc-WASM program fails.

Source

pub fn from_dc_wasm_with_resolver( wasm_doc: &DcMstr, initial_input: &DcMstr, most_recent_node_id: Option<u128>, resolver: &dyn SyntaxRuleResolver, ) -> Result<Self>

Assembles a Dc-WASM document (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program" or wasm_routine) using resolver and instantiates a DcWasmSession.

§Errors

Returns an error if assembling or instantiating the Dc-WASM program fails.

Source

pub fn from_dc_wasm_with_limits( wasm_doc: &DcMstr, initial_input: &DcMstr, most_recent_node_id: Option<u128>, resolver: &dyn SyntaxRuleResolver, resource_limits: DcWasmResourceLimits, ) -> Result<Self>

Assembles a Dc-WASM document (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program" or wasm_routine) using resolver and instantiates a DcWasmSession with explicit DcWasmResourceLimits.

§Errors

Returns an error if assembling or instantiating the Dc-WASM program fails.

Source

pub const fn used_native_substitute(&self) -> bool

Returns true if this session is backed by a registered native substitute.

Source

pub fn instrumented_wasm_bytes(&self) -> &[u8] ⓘ

Returns the portable instrumented .wasm bytes executed by this session.

Because compute-quota accounting is embedded in standard WebAssembly bytecode, running these bytes on any compliant WASM runtime (tinywasm, V8/Node WebAssembly, Wasmtime, etc.) produces identical interruption points and state transitions.

Source

pub const fn resource_limits(&self) -> DcWasmResourceLimits

Returns the active DcWasmResourceLimits for this session.

Source

pub fn set_resource_limits(&mut self, limits: DcWasmResourceLimits)

Updates the DcWasmResourceLimits enforced by this session.

Source

pub fn with_resource_limits(self, limits: DcWasmResourceLimits) -> Self

Builder-style method returning self with updated DcWasmResourceLimits.

Source

pub fn set_shared_task_quota( &mut self, shared: SharedWasmTaskQuota, ) -> Result<()>

Attaches a SharedWasmTaskQuota so that this session shares its compute and cumulative output quota with other sessions in the same evaluation task.

§Errors

Returns an error if the shared quota mutex is poisoned or if start already exceeded the shared task’s remaining compute quota.

Source

pub const fn has_shared_task_quota(&self) -> bool

Returns true if this session is attached to a SharedWasmTaskQuota.

Source

pub fn shared_task_quota(&self) -> Option<SharedWasmTaskQuota>

Returns a clone of the attached SharedWasmTaskQuota, if any.

Source

pub fn with_shared_task_quota(self, shared: SharedWasmTaskQuota) -> Result<Self>

Builder-style method attaching a SharedWasmTaskQuota.

§Errors

Returns an error if Self::set_shared_task_quota fails.

Source

pub fn increase_compute_quota(&mut self, additional_units: u64)

Increases the session’s compute quota allowance by additional_units.

When called after a WasmResourceInterruption::ComputeQuotaExhausted pause, the next Self::step call resumes the paused computation with the increased quota without repeating earlier step side effects.

Source

pub const fn remaining_compute_quota(&self) -> u64

Returns the remaining compute quota units currently available to this session.

Source

pub const fn current_compute_quota_limit(&self) -> u64

Returns the active compute quota limit (initial allowance plus any granted increases).

Source

pub const fn last_interrupted_op_ordinal(&self) -> Option<u64>

Returns the 1-based ordinal of the operation that triggered the most recent WasmResourceInterruption::ComputeQuotaExhausted, if any.

Source

pub const fn last_interrupted_op_required_cost(&self) -> Option<u64>

Returns the compute unit cost required by the operation that triggered the most recent WasmResourceInterruption::ComputeQuotaExhausted, if any.

Source

pub fn exported_global_i32(&self, name: &str) -> Option<i32>

Returns the value of an exported i32 global by name, if present.

Source

pub fn exported_global_i64(&self, name: &str) -> Option<i64>

Returns the value of an exported i64 global by name, if present.

Source

pub fn read_memory(&mut self, offset: usize, len: usize) -> Result<Vec<u8>>

Reads len bytes starting at offset from exported "memory".

§Errors

Returns an error if exported "memory" is missing or offset..offset + len is out of bounds.

Source

pub const fn last_step_instructions(&self) -> u64

Returns the number of portable compute units consumed during the most recent step() call.

Source

pub const fn total_instructions_executed(&self) -> u64

Returns the cumulative number of portable compute units consumed across this session.

Source

pub const fn cumulative_output_bytes(&self) -> usize

Returns the cumulative number of output bytes decoded across all step() calls in this session.

Source

pub const fn last_resource_interruption( &self, ) -> Option<&WasmResourceInterruption>

Returns the most recent WasmResourceInterruption raised by this session, if any.

Source

pub fn current_input(&self) -> &DcMstr

Returns the most recent input document provided to Self::provide_input.

Source

pub fn current_memory_pages(&mut self) -> Result<usize>

Returns the current number of 64 KiB pages allocated across the session store’s linear memories.

§Errors

Returns an error if the exported "memory" cannot be accessed.

Source

pub fn current_table_elements(&self) -> usize

Returns the total number of table elements currently allocated across the session store.

Source

pub const fn base_io_offset(&self) -> usize

Returns the byte offset (input_ptr) where the host places the input payload in linear memory.

Source

pub fn provide_input(&mut self, input: &DcMstr) -> Result<()>

Writes a new input DcMstr payload into WASM linear memory and updates the 32-byte mailbox header at 0..32.

Used both for initial document loading and for supplying the response/mock Dc document before resuming after WasmStepOutcome::RequestCapability.

§Errors

Returns an error if linear memory cannot grow to accommodate the input and output buffers within DcWasmResourceLimits::max_memory_pages.

Source

pub fn provide_capability_response(&mut self, response: &DcMstr) -> Result<()>

Validates and writes a capability response DcMstr into WASM linear memory, enforcing DcWasmResourceLimits::max_capability_payload_bytes before writing the response into the guest mailbox.

§Errors

Returns WasmResourceInterruption::CapabilityPayloadTooLarge if the capability response payload exceeds max_capability_payload_bytes, or an error if writing the payload into linear memory fails.

Source

pub fn step(&mut self) -> Result<WasmStepOutcome>

Executes one pure-compute quantum by calling the module’s exported "step" (or "main") function (or resuming its live suspended continuation after a compute-quota increase) and decoding the output DcMstring from linear memory according to the returned WasmStepStatus.

§Errors

Returns an error if the WASM function traps, exhausts its portable compute quota, returns an invalid status code, exceeds single-step or cumulative output byte budgets, or writes an out-of-bounds or malformed Dc output slice.

Trait Implementations§

Source§

impl Debug for DcWasmSession

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
§

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
§

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