mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
Add documentation
This commit is contained in:
@@ -27,12 +27,14 @@ impl Default for Events {
|
||||
}
|
||||
|
||||
impl Events {
|
||||
/// Creates a new event channel.
|
||||
pub fn new() -> Self {
|
||||
let (sender, receiver) = channel::bounded(1_000);
|
||||
|
||||
Self { receiver, sender }
|
||||
}
|
||||
|
||||
/// Emits an event.
|
||||
pub fn emit(&self, event: Event) {
|
||||
match self.sender.try_send(event) {
|
||||
Ok(()) => {}
|
||||
|
||||
Reference in New Issue
Block a user