Skip to main content

TimerNameLike

Trait TimerNameLike 

Source
pub trait TimerNameLike {
    // Required method
    fn timer_name(&self) -> &str;
}
Expand description

可被定时任务运行时按名称匹配的类型。

已为字符串类型与 generate_name 生成的枚举提供实现,因此 crate::wake 既能接受 "task_name" 这样的字面量,也能接受生成的名称枚举。

Required Methods§

Source

fn timer_name(&self) -> &str

返回与 crate::TimerRegistration::name 一致的原始任务函数名。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TimerNameLike for &String

Source§

fn timer_name(&self) -> &str

Source§

impl TimerNameLike for &str

Source§

fn timer_name(&self) -> &str

Source§

impl TimerNameLike for Cow<'_, str>

Source§

fn timer_name(&self) -> &str

Source§

impl TimerNameLike for String

Source§

fn timer_name(&self) -> &str

Implementors§