puniyu_types 0.5.8

puniyu 通用类型库
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::event::Event;

pub trait Matcher: Send + Sync + 'static {
	/// 获取匹配器名称
	fn name(&self) -> &str;

	/// 获取匹配器优先级
	fn rank(&self) -> u8 {
		5
	}

	/// 匹配事件
	fn matches(&self, event: &Event) -> bool;
}