Skip to main content

ScratchAcousticDsp

Struct ScratchAcousticDsp 

Source
pub struct ScratchAcousticDsp { /* private fields */ }

Implementations§

Source§

impl ScratchAcousticDsp

Source

pub fn new( output_sample_rate: f64, config: JsValue, ) -> Result<ScratchAcousticDsp, JsValue>

Source

pub fn prepare_window( &mut self, channel_count: u32, length: u32, ) -> Result<(), JsValue>

Prepares stable Rust-owned channel storage for a direct AudioWorklet copy. This removes the wasm-bindgen Array traversal from the realtime window replacement path while retaining Rust ownership of source PCM.

Source

pub fn window_channel_ptr(&mut self, channel_index: u32) -> *mut f32

Source

pub fn commit_window( &mut self, source_sample_rate: f64, window_start: u32, total_frames: u32, reset_position: Option<f64>, ) -> Result<(), JsValue>

Publishes a fully copied prepared window. No allocation occurs on the successful path.

Source

pub fn clear_window(&mut self)

Source

pub fn start(&mut self)

Source

pub fn stop(&mut self)

Source

pub fn set_effects(&mut self, acoustic_enabled: bool, surface_enabled: bool)

Source

pub fn set_manual_fader_gain(&mut self, gain: f64) -> Result<(), JsValue>

Source

pub fn set_manual_crossfader(&mut self, position: f64) -> Result<(), JsValue>

Source

pub fn manual_fader_gain(&self) -> f64

Source

pub fn set_momentary_crossfader_override(&mut self, active: bool, open: bool)

Overrides the selected technique while the host control is active. The release returns control to the technique through a de-click ramp.

Source

pub fn set_crossfader_touch_override(&mut self, active: bool, gain: f64)

Gives a touched host fader temporary control of the audible gate. Releasing the fader returns control to the selected scratch technique.

Source

pub fn audible_crossfader_gain(&self) -> f64

Reports the final audible fader gain after all technique and host input.

Source

pub fn set_output_gain( &mut self, gain: f64, ramp_ms: f64, ) -> Result<(), JsValue>

Final post-mix gain used by the host for packet and mixer level. A linear ramp starts from the gain active at the next rendered frame.

Source

pub fn capture_replay_state(&mut self)

Source

pub fn restore_replay_state(&mut self) -> bool

Source

pub fn begin_deterministic_replay( &mut self, position: f64, rotation_turns: f64, replay_seed: u32, ) -> Result<(), JsValue>

Reinitializes every dynamic input that can color a recorded take. The caller must capture the live state first and restore it after the replay transaction. Static PCM, surface assets and selected controls remain in place.

Source

pub fn begin_deterministic_replay_from( &mut self, position: f64, rotation_turns: f64, replay_seed: u32, rate: f64, ) -> Result<(), JsValue>

beginDeterministicReplay, with the platter already turning.

A take punched in on a running record starts at speed. Beginning its replay from rest put a spin-up under the first beat that the take never had: the motor model ramped from zero toward the transport the first events set. rate is the platter’s rate at punch-in, in units of the native speed, and the platter is reset to it rather than toward it.

Source§

impl ScratchAcousticDsp

Source

pub fn share_source(&mut self, other: &ScratchAcousticDsp)

Takes another engine’s record as this engine’s own, without a copy.

The source PCM sits behind an Arc; a headless engine that renders a take’s log to audio shares the live deck’s record for the length of the render and lets it go. The record’s speed, seed and wear come with it, so a log with no world replays on the record as it is. Transport starts from rest at the top of the side.

Source

pub fn arm_revolution( &mut self, start_position: f64, max_frames: u32, replay_seed: u32, ) -> Result<(), &'static str>

armRevolutionCapture, off the wasm binding.

Source

pub fn begin_replay( &mut self, position: f64, rotation_turns: f64, replay_seed: u32, rate: f64, ) -> Result<(), &'static str>

beginDeterministicReplayFrom, off the wasm binding.

The C ABI and the tests come in here: a JsValue cannot be built on a host target, so an invalid argument on the binding’s path is an abort on the phone rather than a refused call.

Source§

impl ScratchAcousticDsp

Source

pub fn arm_revolution_capture( &mut self, start_position: f64, max_frames: u32, replay_seed: u32, ) -> Result<(), JsValue>

Arms a one-revolution capture from the ring starting at start_position (source frames; negative means from wherever the platter is), holding at most max_frames, reseeding the take with replay_seed on the frame it begins. See RevolutionCapture.

Source

pub fn cancel_revolution_capture(&mut self)

Source

pub fn revolution_capture_armed(&self) -> bool

Source

pub fn revolution_capture_began(&self) -> bool

Source

pub fn revolution_capture_done(&self) -> bool

Source

pub fn revolution_capture_overflowed(&self) -> bool

Source

pub fn revolution_capture_start_frame(&self) -> f64

This engine’s rendered-frame counter at the frame the capture began.

Source

pub fn revolution_capture_end_frame(&self) -> f64

This engine’s rendered-frame counter at the frame the capture closed on (exclusive); zero until it has.

Source

pub fn revolution_capture_start_position(&self) -> f64

Source

pub fn revolution_capture_start_rotation_turns(&self) -> f64

Source

pub fn revolution_capture_channels(&self) -> u32

Source

pub fn revolution_capture_frames(&self) -> u32

Source

pub fn take_revolution_capture(&mut self) -> Vec<f32>

The captured revolution, interleaved, and the capture is over.

Source

pub fn rendered_frames(&self) -> f64

Output frames rendered so far, the clock revolutionCaptureStartFrame is on.

Source

pub fn set_high_frequency_acceleration_limit( &mut self, strength: f64, ) -> Result<(), JsValue>

Source

pub fn high_frequency_acceleration_limit(&self) -> f64

Source

pub fn set_stylus_tracing_limit(&mut self, strength: f64) -> Result<(), JsValue>

Source

pub fn stylus_tracing_limit(&self) -> f64

Source

pub fn set_texture_scale(&mut self, scale: f64) -> Result<(), JsValue>

Source

pub fn texture_scale(&self) -> f64

Source

pub fn set_contact_gain(&mut self, gain: f64) -> Result<(), JsValue>

Per-component levels on the surface bed and source texture, each 0 to 4, 1 the historical level. A default changes no sample.

Source

pub fn contact_gain(&self) -> f64

Source

pub fn set_dust_gain(&mut self, gain: f64) -> Result<(), JsValue>

Source

pub fn dust_gain(&self) -> f64

Source

pub fn set_impulse_gain(&mut self, gain: f64) -> Result<(), JsValue>

Source

pub fn impulse_gain(&self) -> f64

Source

pub fn set_wear_gain(&mut self, gain: f64) -> Result<(), JsValue>

Source

pub fn wear_gain(&self) -> f64

Source

pub fn set_source_texture_gain(&mut self, gain: f64) -> Result<(), JsValue>

Source

pub fn source_texture_gain(&self) -> f64

Source

pub fn set_riaa_speed_tilt(&mut self, enabled: bool)

The speed-dependent half of the phono chain, live. At nominal speed the tilt is exactly unity, so toggling it only changes off-speed content — which makes it a clean A/B for how much of scratch’s edge is the pre-emphasis mismatch rather than the groove itself.

Source

pub fn riaa_speed_tilt(&self) -> bool

Source

pub fn set_riaa_voicing(&mut self, rate: f64) -> Result<(), JsValue>

Optional constant-rate RIAA mismatch for vinyl warmth, live. 1.0 is the standard curve and is bit-exact transparent; values above it trade top end for body. The rate is clamped to the same [0.1, 4.0] window as the speed tilt.

Source

pub fn riaa_voicing(&self) -> f64

Source

pub fn set_vinyl_voicing(&mut self, amount: f64) -> Result<(), JsValue>

Optional vinyl voicing amount in [0, 1], live. 0 is bypassed bit-exactly and the blend eases, so toggling it does not click.

Source

pub fn vinyl_voicing(&self) -> f64

Source

pub fn set_vinyl_voicing_curve(&mut self, curve: u32) -> Result<(), JsValue>

Selects one of the voicing shapes live: 0 coil load, 1 tip mass, 2 curve drift. The running filter keeps its delay, so switching does not click.

Source

pub fn vinyl_voicing_curve(&self) -> u32

Source

pub fn set_soft_clip(&mut self, enabled: bool)

Source

pub fn soft_clip(&self) -> bool

Source

pub fn set_scratch_preset(&mut self, name: &str) -> Result<(), JsValue>

Source

pub fn set_scratch_clicks(&mut self, clicks: u8)

Source

pub fn set_scratch_gate_algorithm_version(&mut self, version: u32)

Source

pub fn scratch_preset(&self) -> String

Source

pub fn scratch_clicks(&self) -> u8

Source

pub fn scratch_gate_algorithm_version(&self) -> u32

Source

pub fn scratch_gate(&self) -> f64

Source

pub fn scratch_gate_target(&self) -> f64

Source

pub fn scratch_direction(&self) -> i32

Source

pub fn scratch_moving(&self) -> bool

Source

pub fn scratch_gate_phase(&self) -> f64

Source

pub fn scratch_stroke_progress(&self) -> f64

Source

pub fn set_needle_lifted(&mut self, lifted: bool)

Source

pub fn set_hand_servo( &mut self, stabilization_seconds: f64, max_correction_rad_s: f64, )

How firmly the hand owns the record’s position: the seconds the servo takes to close a position error, and the most it may correct by in rad/s. Non-finite or non-positive values leave that half alone.

Source

pub fn set_native_rpm(&mut self, native_rpm: f64) -> Result<(), JsValue>

Source

pub fn set_slipmat_response(&mut self, slip: f64) -> Result<(), JsValue>

Sets how much the record slips: none at zero, loosest mat at one.

The mat is named for what it does, so the number runs with the name. Zero is the tightest coupling the deck has — the record turns with the platter — and one is the loosest mat, which lets the record slide on after the hand leaves it.

Source

pub fn set_bearing_friction(&mut self, scale: f64) -> Result<(), JsValue>

Scales the platter bearing’s friction: frictionless at zero, the stock deck at one, heavier beyond.

This is the only brake on a platter thrown by hand with the motor off, so it is the knob that decides how long a free spin coasts — from forever at zero to a fast die-off at the top of the range.

Source

pub fn set_free_spin_drive(&mut self, per_second: f64) -> Result<(), JsValue>

Sets the motor-off thrust: e-folds of rate per second while the platter coasts. Zero is a plain bearing; 0.02 is a solar sail’s patience; anything near two doubles the spin faster than a hand could. Clamped there because beyond it the platter is a turbine.

Source

pub fn set_press_defects( &mut self, eccentricity_mm: f64, warp_mm: f64, ) -> Result<(), JsValue>

Press defects: the spindle hole’s eccentricity and the disc’s warp, both in millimetres, both once-per-revolution and angle-indexed.

Source

pub fn set_stylus_tap( &mut self, degrees: f64, level: f64, ) -> Result<(), JsValue>

A second stylus riding the same groove degrees behind the first, mixed at level. Zero level lifts it off.

Source

pub fn set_angle_gate( &mut self, sectors: u32, depth: f64, ) -> Result<(), JsValue>

The angle gate: sectors openings per revolution, cut to depth. Zero sectors is off. Geometry, not tempo-sync: it stays locked under scratching and free-spin decay because it is read off the platter.

Source

pub fn set_vinyl_vfx(&mut self, scene: u32, amount: f64) -> Result<(), JsValue>

The live vinyl Vfx scene: the shared geometry-driven processor the offline REMIX render and the iOS deck already play. Scene zero is off; amount rides 0..=1.

Source

pub fn set_locked_groove(&mut self, start_frame: f64) -> Result<(), JsValue>

Drops the needle into a locked groove starting at start_frame: playback wraps every revolution inside that ring until the host passes a negative frame to clear it. Seeks and hand motion are phase changes inside the ring; they cannot escape it.

Source

pub fn set_groove_wear(&mut self, rate: f64) -> Result<(), JsValue>

Groove wear: every pass of the stylus wears where it passed, adding crackle and dulling the highs in the bars that have been played most. rate scales both how fast wear accrues and how loudly it reads; zero is a mint pressing. At one, a region is fully worn after roughly fifty passes.

Source

pub fn groove_wear_map(&self) -> Vec<f32>

The wear map, for persistence: a record’s biography rides with it.

Source

pub fn restore_groove_wear_map(&mut self, map: &[f32])

Restores a persisted wear map. Length is reconciled to the loaded source; a map from another pressing simply wears the wrong places, which is the caller’s mistake to avoid via the record hash.

Source

pub fn halo_wear_map(&self) -> Vec<f32>

The halo, for a take’s world.

Source

pub fn restore_halo_wear_map(&mut self, map: &[f32])

Source

pub fn seed_take_capture(&mut self, replay_seed: u32)

The seed a take is cut under.

A replay begins from replay_seed — its surface noise and its flutter phase are derived from the take’s identity — so the recording has to have begun from the same place or the two can never agree. Called at punch-in with the take’s seed: the noise generator and the flutter phase are re-seeded, and nothing else moves, because the platter is live and a hand may be on it. Noise is noise, so the join is silent.

Source

pub fn reset_wear(&mut self, scope: &str) -> Result<(), JsValue>

Clears accumulated wear, by scope.

Wear is the one thing here meant to outlive a pass, so it only goes away when something says so — one of these scopes, or a new record on the platter. The scopes are the three things that actually accumulate, and nothing else in the engine does:

  • groove — the WEAR dial’s map, one bucket per WEAR_BUCKET_FRAMES of source, so it wears where the stylus went.
  • halo — WORN HALO’s bins, indexed by phase within one revolution, so it wears where on the turn the stylus went. A different quantity from groove, and cleared separately.
  • polar — the revolution memory ADJACENT GHOST, THREE NEEDLES and SPLIT WALLS read back from, and the filters riding on it.
  • all — the three above.
Source

pub fn groove_wear_level(&self) -> f64

The meters’ numbers, one scalar at a time.

wearSummary allocates a string, which the render thread must not do at telemetry rate, so the worklet reads these instead and the summary is kept for one-shot queries. Each walks its buffer and allocates nothing.

Source

pub fn groove_wear_peak(&self) -> f64

Source

pub fn groove_wear_buckets(&self) -> u32

Source

pub fn halo_wear_level(&self) -> f64

Source

pub fn halo_wear_peak(&self) -> f64

Source

pub fn polar_fill(&self) -> f64

Source

pub fn wear_bytes(&self) -> u32

Every accumulator’s real allocation, in bytes.

Source

pub fn wear_summary(&self) -> String

What each accumulator is holding — the numbers behind the meters.

Levels are 0..=1 and bytes are the real allocation, so a deck can report what the revolution memory actually costs rather than quoting a constant that drifts when the bin counts change.

Source

pub fn set_pressing_seed(&mut self, seed: u32)

Seeds this pressing’s surface character. Two pressings of the same track crackle like two copies, not two files; zero keeps the classic pattern.

Source

pub fn native_rpm(&self) -> f64

Source

pub fn platter_rotation_turns(&self) -> f64

Source

pub fn deck_recovery_count(&self) -> u64

Counts rejected deck steps that used the last valid motion state.

Source

pub fn set_motion(&mut self, position: f64, rate: f64, impulse: f64)

Source

pub fn set_transport( &mut self, hand_contact: bool, motor_rate: f64, hand_rate: f64, grip: f64, )

Source

pub fn set_position(&mut self, position: f64, impulse: f64)

Source

pub fn reset_position_export(&mut self, position: f64)

Source

pub fn render(&mut self, frame_count: u32, output_channel_count: u32) -> u32

Source

pub fn render_window_missing( &mut self, frame_count: u32, output_channel_count: u32, )

Source

pub fn render_surface(&mut self, frame_count: u32, output_channel_count: u32)

Render only cartridge/surface foley while keeping the programme readhead fixed. Lead-in and run-out are physical platter regions, not permission to sample the first or last seconds of programme audio underneath them.

Source

pub fn output_ptr(&self) -> *const f32

Source

pub fn output_len(&self) -> usize

Source

pub fn position(&self) -> f64

Source

pub fn effective_rate(&self) -> f64

Source

pub fn take_window_request(&mut self) -> f64

Source

pub fn take_ended(&mut self) -> bool

Source

pub fn set_surface_asset( &mut self, channels: Array, sample_rate: f64, ) -> Result<(), JsValue>

Decoded needle-surface asset PCM (original assets/audio/needle-surface.opus), provided by the host off the real-time thread.

Source

pub fn set_surface_gain_multiplier(&mut self, multiplier: f64)

Mobile speaker compensation (original resolveNeedleSurfaceGain: ×2.25 on mobile).

Source

pub fn start_surface_region(&mut self, region: u8, duration_seconds: f64)

Start the lead-in (region 0) or deadwax (region 1) surface bed.

Source

pub fn stop_surface_region(&mut self)

Source

pub fn trigger_needle_drop(&mut self)

One-shot needle-drop foley: stylus thump plus a settling crackle burst.

Source

pub fn trigger_needle_lift(&mut self)

Starts a lighter stylus-release thump and a short crackle burst.

Source§

impl ScratchAcousticDsp

Source

pub fn new_native( output_sample_rate: f64, config: AcousticConfig, ) -> Result<Self, String>

Creates the shared player for a native host.

Source

pub fn deck_recovery_diagnostic(&self) -> Option<DeckRecoveryDiagnostic>

Source

pub fn set_surface_asset_native( &mut self, channels: &[&[f32]], sample_rate: f64, ) -> Result<(), String>

Installs host-decoded surface PCM without routing native audio through JavaScript typed arrays. Native mono renderers use the first channel, while stereo renderers preserve both channels exactly as the WASM host does through setSurfaceAsset.

Source

pub fn set_surface_asset_owned_native( &mut self, channels: Vec<Vec<f32>>, sample_rate: f64, ) -> Result<(), String>

Installs already-owned native surface PCM with an O(1) audio-state swap. Hosts can allocate and copy the large asset before taking their render-state lock.

Source

pub fn set_surface_asset_owned_native_deferred( &mut self, channels: Vec<Vec<f32>>, sample_rate: f64, ) -> Result<Arc<Vec<Vec<f32>>>, String>

Installs owned surface PCM and returns the previous allocation so a native host can retire it after releasing its realtime-state mutex.

Source

pub fn replace_window_native( &mut self, channels: &[&[f32]], source_sample_rate: f64, reset_position: Option<f64>, ) -> Result<(), String>

Replaces the complete source window with host-owned PCM.

Source

pub fn replace_window_owned_native( &mut self, channels: Vec<Vec<f32>>, source_sample_rate: f64, reset_position: Option<f64>, ) -> Result<(), String>

Replaces native source PCM with an O(1) ownership swap. The host must build the channel vectors before entering its real-time state lock.

Source

pub fn replace_window_owned_native_deferred( &mut self, channels: Vec<Vec<f32>>, source_sample_rate: f64, reset_position: Option<f64>, ) -> Result<Arc<Vec<Vec<f32>>>, String>

Publishes a complete native source window and returns the previous Arc so its potentially large backing allocation can be dropped after the host releases the realtime-state mutex.

Source

pub fn extend_window_native( &mut self, channels: &[&[f32]], source_sample_rate: f64, ) -> Result<(), String>

Extends the current native source without resetting transport state.

Source

pub fn extend_window_owned_native( &mut self, channels: Vec<Vec<f32>>, source_sample_rate: f64, ) -> Result<(), String>

Extends the current native source from already-owned PCM. Native hosts can copy each decode chunk before entering their render-state lock. If the initial window reserved the final programme capacity, publication is a bounded O(chunk) copy with no allocation or prefix rebuild.

Source

pub fn replace_window_range_native( &mut self, channels: &[&[f32]], start_frame: usize, source_sample_rate: f64, ) -> Result<(), String>

Replaces a range in the current native source without resetting transport.

The range can extend the source. Missing frames between the old source end and the new range are silent.

Source

pub fn native_window_snapshot(&self) -> (Arc<Vec<Vec<f32>>>, f64)

Returns an immutable, constant-time snapshot of the native PCM window. Native hosts use it to build append/range replacements away from their realtime render mutex, then publish the result with replace_window_owned_native as one ownership swap.

Source

pub fn rendered_samples(&self) -> &[f32]

Returns the interleaved output from the most recent render call.

Source§

impl ScratchAcousticDsp

Source

pub fn reset_wear_scope(&mut self, scope: WearScope)

Clears one accumulator, off the wasm binding.

resetWear is the browser’s door onto this; the C ABI and the tests come in here instead, because a JsValue cannot be built off wasm32.

Trait Implementations§

Source§

impl From<ScratchAcousticDsp> for JsValue

Source§

fn from(value: ScratchAcousticDsp) -> Self

Converts to this type from the input type.
Source§

impl FromWasmAbi for ScratchAcousticDsp

Source§

type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi. Read more
Source§

impl IntoWasmAbi for ScratchAcousticDsp

Source§

type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> Self::Abi

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl LongRefFromWasmAbi for ScratchAcousticDsp

Source§

type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRef<ScratchAcousticDsp>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl OptionFromWasmAbi for ScratchAcousticDsp

Source§

fn is_none(abi: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl OptionIntoWasmAbi for ScratchAcousticDsp

Source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl RefFromWasmAbi for ScratchAcousticDsp

Source§

type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>

The Wasm ABI type references to Self are recovered from.
Source§

type Anchor = RcRef<ScratchAcousticDsp>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl RefMutFromWasmAbi for ScratchAcousticDsp

Source§

type Abi = WasmPtr<WasmRefCell<ScratchAcousticDsp>>

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRefMut<ScratchAcousticDsp>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl SupportsConstructor for ScratchAcousticDsp

Source§

impl SupportsInstanceProperty for ScratchAcousticDsp

Source§

impl SupportsStaticProperty for ScratchAcousticDsp

Source§

impl TryFromJsValue for ScratchAcousticDsp

Source§

fn try_from_js_value(value: JsValue) -> Result<Self, JsValue>

Performs the conversion.
Source§

fn try_from_js_value_ref(value: &JsValue) -> Option<Self>

Performs the conversion.
Source§

impl VectorFromWasmAbi for ScratchAcousticDsp

Source§

impl VectorIntoWasmAbi for ScratchAcousticDsp

Source§

impl WasmDescribe for ScratchAcousticDsp

Source§

impl WasmDescribeVector for ScratchAcousticDsp

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

Source§

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more