Add default implementations for StateEvent.

This commit is contained in:
Jimmy Cuadra 2015-11-29 18:34:37 -08:00
parent 3c9f84cec1
commit 9027948381

View File

@ -21,7 +21,12 @@ pub trait RoomEvent<'a, T>: Event<'a, T> {
/// An event that represents some aspect of a room's state.
pub trait StateEvent<'a, 'b, T>: RoomEvent<'a, T> {
/// Previous content for this aspect of room state.
fn prev_content(&'a self) -> Option<&'b T>;
fn prev_content(&'a self) -> Option<&'b T> {
None
}
/// A unique key which defines the overwriting semantics for this aspect of room state.
fn state_key(&self) -> &'a str;
fn state_key(&self) -> &'a str {
""
}
}