pub trait Notifier: Send + Sync {
// Required method
fn send(&self, notification: Notification) -> Result<(), NotifyError>;
}Expand description
通知发送器 trait — 对齐 PHP think\notify\Notifier
抽象通知发送行为,业务方实现具体发送逻辑(Slack Webhook / 短信 API / 日志等)。
§PHP 对齐
// PHP think\notify\Notifier 接口
interface Notifier {
public function send(Message $message): bool;
}Required Methods§
Sourcefn send(&self, notification: Notification) -> Result<(), NotifyError>
fn send(&self, notification: Notification) -> Result<(), NotifyError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".