Bound Event
by FromStr
.
This commit is contained in:
parent
b88c621214
commit
abac13a7dd
@ -112,6 +112,7 @@
|
|||||||
use std::{
|
use std::{
|
||||||
error::Error,
|
error::Error,
|
||||||
fmt::{Debug, Display, Error as FmtError, Formatter, Result as FmtResult},
|
fmt::{Debug, Display, Error as FmtError, Formatter, Result as FmtResult},
|
||||||
|
str::FromStr,
|
||||||
};
|
};
|
||||||
|
|
||||||
use js_int::UInt;
|
use js_int::UInt;
|
||||||
@ -431,7 +432,7 @@ pub enum EventType {
|
|||||||
/// A basic event.
|
/// A basic event.
|
||||||
pub trait Event
|
pub trait Event
|
||||||
where
|
where
|
||||||
Self: Debug + Serialize,
|
Self: Debug + FromStr + Serialize,
|
||||||
{
|
{
|
||||||
/// The type of this event's `content` field.
|
/// The type of this event's `content` field.
|
||||||
type Content: Debug + Serialize;
|
type Content: Debug + Serialize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user