Skip to main content

ConfiguredRuntime

Struct ConfiguredRuntime 

pub struct ConfiguredRuntime<M, C, P, H, E = MpscTaskQueue, I = MpscIdleTaskQueue, T = DefaultTimerDriver<C, RuntimeTag<C>>>{ /* private fields */ }
Expand description

一份固定线程服务,不可Send/Sync;不创建或接管外部线程的所有权。 常规使用SerialRuntime/ConcurrentRuntime,无需填写内部参数;定制类型由with_components推导。 释放(drop)先撤本地权限,再按原执行器(executor)及任务域约定实际退出。 正在进行的同步活动可延迟实际本地清理,不等待普通共享句柄(shared handle)全部释放。 关闭请求、服务不可用与成功完成分别观察,清理失败不能报CloseState::Completed。 waiting_for_wake_count及pending_cancel_task_count沿默认执行器按需O(n)扫描登记,n为登记规模; 封装不把这两项查询转为固定成本,默认推进不主动采集。

Implementations§

§

impl<M, C, P, H, E, I, T> ConfiguredRuntime<M, C, P, H, E, I, T>

pub fn submit_local_front(task: UnsubmittedTask) -> RawResult<(), SubmitError>

由当前原线程把首次提交放内部头;无本地权限时返原值及原因。

pub fn spawn_local_front_with_config<F, V>( future: F, config: TaskConfig<V>, ) -> RawResult<LocalTaskHandle<F::Output, V>, SpawnError<F, ThreadNotifier, V, LocalOutput>>
where F: Future + 'static, F::Output: 'static, V: Send + Sync + 'static,

本地队首便利派发;与spawn_local相同原值及权限,只改变下一次排队优先级。

pub fn spawn_local_front<F>( future: F, ) -> RawResult<LocalTaskHandle<F::Output>, SpawnError<F, ThreadNotifier, (), LocalOutput>>
where F: Future + 'static, F::Output: 'static,

默认附加数据(metadata)的本地队首入口,不增加F的Send/Sync/Unpin。

Examples found in repository?
examples/runtime_bounds.rs (line 61)
39fn roots(runtime: &ConcurrentRuntime, handle: &Handle) {
40    let value = Rc::new(7);
41    let _: Rc<usize> = runtime.block_on(Borrowed {
42        value: &value,
43        fixed: PhantomPinned,
44    });
45    let _: Rc<usize> = handle.block_on(Borrowed {
46        value: &value,
47        fixed: PhantomPinned,
48    });
49    let _ = runtime.timeout_on(
50        Borrowed {
51            value: &value,
52            fixed: PhantomPinned,
53        },
54        std::time::Duration::from_millis(1),
55    );
56    let _ = handle.spawn(SendNotSync {
57        value: Cell::new(3),
58        fixed: PhantomPinned,
59    });
60    let _ = ConcurrentRuntime::spawn_local(async { Rc::new(1usize) });
61    let _ = ConcurrentRuntime::spawn_local_front(async { Rc::new(2usize) });
62    let _ = SerialRuntime::idle_local(async { Cell::new(4usize) });
63    let _ = handle.wait_one_timeout::<Rc<usize>>(std::time::Duration::from_secs(2));
64}
§

impl<M, C, P, H, E, I, T> ConfiguredRuntime<M, C, P, H, E, I, T>

pub fn run_once(&mut self) -> Result<TurnResult>

原线程一次有限事件循环(event loop),返回后保留本地权限;不自行停放线程。 其它线程可继续通过Handle提交;同步控制hook和原F仍可能阻塞本次调用。

pub fn run(&mut self) -> Result<()>

原线程持续推动同服务,直到关闭或首个推进错误;没有隐式工作线程。

§

impl<M: RuntimeMode> ConfiguredRuntime<M, ManualClock, DefaultIdlePolicy, NoHooks>

pub fn new() -> Result<Self>

默认配置及策略构造;外部必须已安装pi_clock全局时间轴,失败保原报告(Report)。

pub fn with_options(options: RuntimeOptions) -> Result<Self>

采用指定工作额度;不改变创建线程归属,不安装全局时钟或启动线程。

pub fn with_components<C, P, H>( clock: C, policy: P, hooks: H, options: RuntimeOptions, ) -> Result<ConfiguredRuntime<M, C, P, H>>

由参数推导定制类型,不把内部队列泛型传播到调用点。

Examples found in repository?
examples/runtime_bounds.rs (lines 70-75)
65fn declarations(clock: ManualClock) {
66    send_sync::<Handle>();
67    capabilities::<ConcurrentRuntime>();
68    capabilities::<SerialRuntime>();
69    capabilities::<Handle>();
70    let _ = ConcurrentRuntime::with_components(
71        clock,
72        LocalPolicy(Rc::new(())),
73        LocalHooks(Rc::new(())),
74        RuntimeOptions::default(),
75    );
76}

pub fn with_queues<E, I, F, T>( options: RuntimeOptions, queues: RuntimeQueues<ManualClock, E, I, F>, ) -> Result<ConfiguredRuntime<M, ManualClock, DefaultIdlePolicy, NoHooks, E, I, T>>

当前线程构造,分别使用指定的队列(queue)和各缺项的默认来源。 时钟(clock)、空闲策略及钩子(hook)沿原默认,失败保留原报告(Report)。

按值接收选配。构造失败时,原线程释放已移交的队列管理者和未调用的回调(callback); 返回的报告(Report)不含这些值,也不会交出尚未完成的运行时(runtime)。

pub fn with_components_and_queues<C, P, H, E, I, F, T>( clock: C, policy: P, hooks: H, options: RuntimeOptions, queues: RuntimeQueues<C, E, I, F>, ) -> Result<ConfiguredRuntime<M, C, P, H, E, I, T>>

同时选择同源时钟(clock)、策略、钩子(hook)及具象队列(queue)。 管理者随运行时(runtime)接管,计时构造回调使用本次的线程通知句柄(ThreadNotifier)。

按值接收选配。选项校验或任一来源准备失败时,原线程释放已接管的资源和 未调用的回调(callback)。直接返回原报告(Report),调用方不会取得半成品。

§

impl<M, C, P, H> ConfiguredRuntime<M, C, P, H>

pub fn from_components( clock: C, policy: P, hooks: H, options: RuntimeOptions, ) -> Result<Self>

静态替换同源时钟、空闲/休眠策略及钩子;无额外Send/Sync/Default约束强加给P/H。 模式M固定普通新业务接纳;策略不能把串行改成并发。

§

impl<M, C, P, H, E, I, T> ConfiguredRuntime<M, C, P, H, E, I, T>

pub fn handle(&self) -> RuntimeHandle<C, E::Handle, I::Handle, T>

取得同一服务的共享访问;不移交服务推进权,也不延长本地Future的清理。

Trait Implementations§

§

impl<M, C, P, H, E, I, T> Drop for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
§

impl<M, C, P, H, E, I, T> IdleDispatch for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn submit_idle(&self, task: UnsubmittedTask) -> RawResult<(), SubmitError>

向同一服务的空闲来源提交普通Send任务(Task);不检查空闲、不保证未来接纳。
§

fn idle_local_with_config<F, V>( future: F, config: TaskConfig<V>, ) -> RawResult<TaskHandle<F::Output, V>, SpawnError<F, ThreadNotifier, V>>
where F: Future + Send + 'static, F::Output: Send + 'static, V: Send + Sync + 'static,

从当前环境定位原服务后提交共享空闲来源;Future与输出要求Send,不要求Sync,不预先绑定执行线程。
Source§

fn idle_with_config<F, M>( &self, future: F, config: TaskConfig<M>, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M>, SpawnError<F, Self::Notifier, M>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static, M: Send + Sync + 'static,

创建并提交空闲时任务(idle task);成功只证明来源接受,不保证执行。
Source§

fn idle<F>( &self, future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static,

默认配置的空闲提交;任务(Task)未接纳前仍可按原控制能力取消。
Source§

fn idle_local<F>( future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static,

默认配置的当前空闲提交;输入保持Send约束,不等同spawn_local的本地非Send能力。
§

impl<M, C, P, H, E, I, T> LocalTaskDispatch for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn create_local_with_config<F, V>( future: F, config: TaskConfig<V>, ) -> RawResult<(UnsubmittedTask, LocalTaskHandle<F::Output, V>), CreateError<F, V>>
where F: Future + 'static, F::Output: 'static, V: Send + Sync + 'static,

通过当前有效本地权限创建;原Future与输出保持原线程清理,不要求Send/Sync/Unpin。失败返还原输入。
§

fn submit_local(task: UnsubmittedTask) -> RawResult<(), SubmitError>

仅在原所属线程(owner thread)的有效本地范围首次提交;错误返还同一待提交值。
Source§

fn create_local<F>( future: F, ) -> Result<(UnsubmittedTask, TaskHandle<Self::Notifier, <F as Future>::Output, (), LocalOutput>), CreateError<F, ()>>
where F: Future + 'static, <F as Future>::Output: 'static,

使用默认配置进行本地创建;无合法当前环境时明确失败,不猜测目标。
Source§

fn spawn_local_with_config<F, M>( future: F, config: TaskConfig<M>, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M, LocalOutput>, SpawnError<F, Self::Notifier, M, LocalOutput>>
where F: Future + 'static, <F as Future>::Output: 'static, M: Send + Sync + 'static,

组合本地创建与本地提交;不把结果变为可跨线程,不将拒绝当成取消。
Source§

fn spawn_local<F>( future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, (), LocalOutput>, SpawnError<F, Self::Notifier, (), LocalOutput>>
where F: Future + 'static, <F as Future>::Output: 'static,

默认配置的本地快速派发(local dispatch);不创建新线程,不内联轮询(poll)。
§

impl<M, C, P, H, E, I, T> RuntimeBlockOn for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn block_on<F: Future>(&self, future: F) -> F::Output

原线程独占服务并推进根,根完成即返回;没有&mut self或F额外约束。 非法嵌套/不同当前目标在首次poll前panic;关闭后只推进独立根,不重开服务。 服务推进失败以原pi_result::Error为panic载荷,保留报告链;根自身panic原样传播。

§

impl<M, C, P, H, E, I, T> RuntimeContext for ConfiguredRuntime<M, C, P, H, E, I, T>

§

type Handle = RuntimeHandle<C, <E as ExternalQueueManager>::Handle, <I as IdleQueueManager>::Handle, T>

§

fn handle(&self) -> RuntimeHandle<C, E::Handle, I::Handle, T>

取得原服务的共享句柄(shared handle);Clone不复制服务,普通释放不自动关闭。
Source§

fn try_current() -> Result<Self::Handle, CurrentRuntimeAccessError>

取得并克隆(Clone)当前所选原服务的共享句柄(shared handle),不产生本地或推进权限。 无当前目标、句柄类型(type)不匹配或线程局部存储(TLS)不可访问时返回对应错误。 有效公共选择在原服务关闭后仍可读取关闭事实,不会重新开放服务。
Source§

fn try_with_current<R>( action: impl FnOnce(&Self::Handle) -> R, ) -> Result<R, CurrentRuntimeAccessError>

同步借用不能逃逸或跨await;公共环境关闭后仍可读原关闭事实。
Source§

fn enter<R>( &self, action: impl FnOnce() -> R, ) -> Result<R, CurrentRuntimeAccessError>

同目标允许嵌套,不授予本地权限;闭包返回Future不会延长本次选择范围。
§

impl<M, C, P, H, E, I, T> RuntimeControl for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn request_close(&self) -> CloseRequestStatus

请求一旦记录不因通知异常回滚,无人推进也不拒绝合法请求。
§

impl<M, C, P, H, E, I, T> RuntimeQuery for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn id(&self) -> RuntimeId

读取原服务或任务(Task)的固定身份;不创建新身份或权限。
§

fn status(&self) -> RuntimeStatus

只读采样原服务Open/Closing/Closed;不推进服务,不保证下一次提交成功。
§

fn is_driving(&self) -> bool

查询原服务推进权当前是否实际持有;包括停放与同步钩子(hook),根专用推进不计入。
§

fn last_idle_state(&self) -> IdleState

读取最近一次成功策略判断的Unknown/Idle/NotIdle,不重新调用策略。
§

fn close_state(&self) -> CloseState

读取自洽的关闭进度样本;Completed不代表最后共享存储已释放。
§

fn external_task_count(&self) -> usize

读取已被本外部来源接收、尚未交付或合法清理的数量;与其它项独立取样。
§

fn internal_task_count(&self) -> usize

读取原内部可执行来源的数量样本;不包括纯挂起任务(Task)。
§

fn timer_registration_count(&self) -> usize

包括纯计时信号,不把每项都称为业务任务(Task)。
§

fn idle_task_count(&self) -> usize

读取空闲来源尚保管的原任务(Task)数量;不调用空闲策略。
§

fn in_flight_task_count(&self) -> usize

读取已接纳且自身退出责任未结束的任务(Task)数量;不以队列数相减推导。
§

fn waiting_for_wake_count(&self) -> usize

仅已接纳、根Pending交接完成且无唤醒/取消/退出需求者。 查询成本由具体实现公开,不承诺所有实现O(1);默认执行器(executor)实现按需O(n)扫描登记。
§

fn pending_cancel_task_count(&self) -> usize

原取消已记录但最终控制结果尚未确定;重复请求不重复计数。 查询成本由具体实现公开;默认执行器(executor)实现按需O(n)扫描,默认事件循环(event loop)不主动采集。
§

impl<M, C, P, H, E, I, T> RuntimeTime for ConfiguredRuntime<M, C, P, H, E, I, T>

§

type Timer = <T as ExecutorTimer>::Access

§

fn timeout(&self, duration: Duration) -> Timeout<Self::Timer> ⓘ

准备惰性计时等待;正时长首次poll才取时登记,至少1ms;零时长让出一次且不可取消。
§

fn timeout_on<F: Future>( &self, future: F, duration: Duration, ) -> TimeoutOn<Self::Timer, F> ⓘ

按业务优先组合Future与计时;不要求额外Unpin/Send/Sync/’static,完成时撤销另一等待兴趣。
§

fn sleep(&self, duration: Duration) -> Sleep<Self::Timer> ⓘ

准备短时等待;正时长范围1ms至1s,不返回独立控制句柄(handle),首次poll才开始。
§

fn timeout_local( duration: Duration, ) -> RawResult<Timeout<Self::Timer>, LocalRuntimeAccessError>

使用当前有效的本地运行时(runtime)准备计时等待,正时长首次登记直达其本地定时任务队列。 当前本地环境不可用时同步返回错误;计时及取消(cancellation)沿用 timeout。
§

fn timeout_on_local<F: Future>( future: F, duration: Duration, ) -> RawResult<TimeoutOn<Self::Timer, F>, LocalRuntimeAccessError>

通过当前有效的本地运行时组合业务异步计算(Future)与超时(timeout)。 业务优先,只有挂起才登记计时;业务不增加 Send、Sync、Unpin 或 ’static 约束。
§

fn sleep_local( duration: Duration, ) -> RawResult<Sleep<Self::Timer>, LocalRuntimeAccessError>

使用当前有效的本地运行时准备短时等待,时长与完成语义沿用 sleep。
§

impl<M, C, P, H, E, I, T> RuntimeWait for ConfiguredRuntime<M, C, P, H, E, I, T>

Source§

fn wait_one_timeout<T>( &self, duration: Duration, ) -> (WaitOneTimeout<Self::Timer, T>, OneSender<T>)

返回一次交值等待与原单发送者;通过timeout_on组合,不新增T的Send/Sync/’static/Unpin约束。
Source§

fn wait_any_timeout<T>( &self, duration: Duration, ) -> (WaitAnyTimeout<Self::Timer, T>, AnySender<T>)

返回并发竞争一次交值的等待与可克隆发送者;保留原胜者及关闭错误语义。
Source§

fn wait_all_timeout<T>( &self, duration: Duration, ) -> (WaitAllTimeout<Self::Timer, T>, AllSender<T>)

返回全部交值等待与原登记发送者;正常返回完整有序向量,超时不交部分结果。
§

impl<M, C, P, H, E, I, T> TaskDispatch for ConfiguredRuntime<M, C, P, H, E, I, T>

§

type Notifier = ThreadNotifier

§

fn create_with_config<F, V>( &self, future: F, config: TaskConfig<V>, ) -> RawResult<(UnsubmittedTask, TaskHandle<F::Output, V>), CreateError<F, V>>
where F: Future + Send + 'static, F::Output: Send + 'static, V: Send + Sync + 'static,

创建原服务的可跨线程任务(Task)并保留配置;不提交、不接纳、不轮询(poll)。失败返还原Future和配置。
§

fn submit(&self, task: UnsubmittedTask) -> RawResult<(), SubmitError>

向创建它的原服务提交唯一原值;明确拒绝返还原持有及原因,不取消、不改线程归属。
Source§

fn create<F>( &self, future: F, ) -> Result<(UnsubmittedTask, TaskHandle<Self::Notifier, <F as Future>::Output>), CreateError<F, ()>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static,

使用默认配置创建;返回唯一待提交值与结果句柄(handle),不隐式派发。
Source§

fn spawn_with_config<F, M>( &self, future: F, config: TaskConfig<M>, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output, M>, SpawnError<F, Self::Notifier, M>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static, M: Send + Sync + 'static,

组合一次创建与提交;错误按创建/提交阶段保留对应原值,成功不表示已经执行。
Source§

fn spawn<F>( &self, future: F, ) -> Result<TaskHandle<Self::Notifier, <F as Future>::Output>, SpawnError<F, Self::Notifier>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static,

使用默认配置组合创建与提交;输入及输出只要求可跨线程转交(Send),不要求Sync或Unpin。
§

impl<M, C, P, H, E, I, T> TimedTaskDispatch for ConfiguredRuntime<M, C, P, H, E, I, T>

§

fn spawn_timing_with_config<F, V>( &self, future: F, delay: Duration, config: TaskConfig<V>, ) -> RawResult<TaskHandle<CoreTimedTaskNotifier<ThreadNotifier, T::Access>, F::Output, V>, SpawnError<F, CoreTimedTaskNotifier<ThreadNotifier, T::Access>, V>>
where F: Future + Send + 'static, F::Output: Send + 'static, V: Send + Sync + 'static,

同步固定本次截止时间并提交定时来源;准备失败保原Future,明确拒绝保原任务(Task)和结果句柄(handle)。
§

fn spawn_timing_local_with_config<F, V>( future: F, delay: Duration, config: TaskConfig<V>, ) -> RawResult<TaskHandle<CoreTimedTaskNotifier<ThreadNotifier, T::Access>, F::Output, V, LocalOutput>, SpawnError<F, CoreTimedTaskNotifier<ThreadNotifier, T::Access>, V, LocalOutput>>
where F: Future + 'static, F::Output: 'static, V: Send + Sync + 'static,

当前原线程内同步定时派发(timed dispatch);原Future/输出不要求Send/Sync,准备和拒绝均保留原值。
Source§

fn spawn_timing<F>( &self, future: F, delay: Duration, ) -> Result<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, <F as Future>::Output>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>>>
where F: Future + Send + 'static, <F as Future>::Output: Send + 'static,

默认配置的同步定时派发(timed dispatch);零时长仍入定时来源,不直接执行。
Source§

fn spawn_timing_local<F>( future: F, delay: Duration, ) -> Result<TaskHandle<TimedTaskNotifier<Self::Notifier, Self::Timer>, <F as Future>::Output, (), LocalOutput>, SpawnError<F, TimedTaskNotifier<Self::Notifier, Self::Timer>, (), LocalOutput>>
where F: Future + 'static, <F as Future>::Output: 'static,

默认配置的本地定时派发(timed dispatch);不跳过原所属域或定时来源。

Auto Trait Implementations§

§

impl<M, C, P, H, E = MpscTaskQueue, I = MpscIdleTaskQueue, T = DefaultTimerDriver<C, RuntimeTag<C>>> !Freeze for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E = MpscTaskQueue, I = MpscIdleTaskQueue, T = DefaultTimerDriver<C, RuntimeTag<C>>> !RefUnwindSafe for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E = MpscTaskQueue, I = MpscIdleTaskQueue, T = DefaultTimerDriver<C, RuntimeTag<C>>> !Send for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E = MpscTaskQueue, I = MpscIdleTaskQueue, T = DefaultTimerDriver<C, RuntimeTag<C>>> !Sync for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E = MpscTaskQueue, I = MpscIdleTaskQueue, T = DefaultTimerDriver<C, RuntimeTag<C>>> !UnwindSafe for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E, I, T> Forget for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E, I, T> Move for ConfiguredRuntime<M, C, P, H, E, I, T>

§

impl<M, C, P, H, E, I, T> Unpin for ConfiguredRuntime<M, C, P, H, E, I, T>
where RuntimeHandle<C, <E as ExternalQueueManager>::Handle, <I as IdleQueueManager>::Handle, T>: Unpin, RefCell<Option<RuntimeData<M, C, P, H, E, I, T>>>: Unpin,

§

impl<M, C, P, H, E, I, T> UnsafeUnpin for ConfiguredRuntime<M, C, P, H, E, I, T>
where RuntimeHandle<C, <E as ExternalQueueManager>::Handle, <I as IdleQueueManager>::Handle, T>: UnsafeUnpin, RefCell<Option<RuntimeData<M, C, P, H, E, I, T>>>: UnsafeUnpin,

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

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.