pub enum Stage {
Measured(Duration),
Unavailable(&'static str),
NotApplicable,
}Expand description
一个统计阶段。
为什么不用 Option<Duration> 表达“没测到“:那样无法区分“这个后端压根没有这个阶段“
与“有这个阶段但本帧测不了“,而二者的排查方向完全不同(前者是设计,后者是缺陷)。
Variants§
Measured(Duration)
真实测量值。Measured(Duration::ZERO) 是合法值(阶段确实执行了,极快)。
阶段存在,但本阶段无法可靠测量;参数是原因(非空,'static 不分配)。
NotApplicable
该后端没有这个阶段(例:CPU 后端没有 gpu_execute)。
Implementations§
Trait Implementations§
impl Copy for Stage
impl Eq for Stage
impl StructuralPartialEq for Stage
Auto Trait Implementations§
impl Forget for Stage
impl Freeze for Stage
impl Move for Stage
impl RefUnwindSafe for Stage
impl Send for Stage
impl Sync for Stage
impl Unpin for Stage
impl UnsafeUnpin for Stagewhere
&'static str: UnsafeUnpin,
impl UnwindSafe for Stagewhere
&'static str: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more