Prepend "Event" to event type names.

This commit is contained in:
Jimmy Cuadra 2015-11-29 06:17:14 -08:00
parent f700cdf8b7
commit df73d2815a
3 changed files with 40 additions and 40 deletions

View File

@ -3,15 +3,15 @@
use core::{Event, RoomEvent}; use core::{Event, RoomEvent};
/// This event is sent by the callee when they wish to answer the call. /// This event is sent by the callee when they wish to answer the call.
pub struct Answer<'a> { pub struct AnswerEvent<'a> {
content: AnswerContent<'a>, content: AnswerEventContent<'a>,
event_id: String, event_id: String,
room_id: String, room_id: String,
user_id: String, user_id: String,
} }
impl<'a> Event<'a, AnswerContent<'a>> for Answer<'a> { impl<'a> Event<'a, AnswerEventContent<'a>> for AnswerEvent<'a> {
fn content(&'a self) -> &'a AnswerContent { fn content(&'a self) -> &'a AnswerEventContent {
&self.content &self.content
} }
@ -20,7 +20,7 @@ impl<'a> Event<'a, AnswerContent<'a>> for Answer<'a> {
} }
} }
impl<'a> RoomEvent<'a, AnswerContent<'a>> for Answer<'a> { impl<'a> RoomEvent<'a, AnswerEventContent<'a>> for AnswerEvent<'a> {
fn event_id(&'a self) -> &'a str { fn event_id(&'a self) -> &'a str {
&self.event_id &self.event_id
} }
@ -34,8 +34,8 @@ impl<'a> RoomEvent<'a, AnswerContent<'a>> for Answer<'a> {
} }
} }
/// The payload of an `Answer` event. /// The payload of an `AnswerEvent`.
pub struct AnswerContent<'a> { pub struct AnswerEventContent<'a> {
/// The VoIP session description. /// The VoIP session description.
answer: SessionDescription<'a>, answer: SessionDescription<'a>,
/// The ID of the call this event relates to. /// The ID of the call this event relates to.
@ -62,15 +62,15 @@ pub enum SessionDescriptionType {
/// This event is sent by callers after sending an invite and by the callee after answering. /// This event is sent by callers after sending an invite and by the callee after answering.
/// Its purpose is to give the other party additional ICE candidates to try using to communicate. /// Its purpose is to give the other party additional ICE candidates to try using to communicate.
pub struct Candidates<'a> { pub struct CandidatesEvent<'a> {
content: CandidatesContent<'a>, content: CandidatesEventContent<'a>,
event_id: &'a str, event_id: &'a str,
room_id: &'a str, room_id: &'a str,
user_id: &'a str, user_id: &'a str,
} }
impl<'a> Event<'a, CandidatesContent<'a>> for Candidates<'a> { impl<'a> Event<'a, CandidatesEventContent<'a>> for CandidatesEvent<'a> {
fn content(&'a self) -> &'a CandidatesContent { fn content(&'a self) -> &'a CandidatesEventContent {
&self.content &self.content
} }
@ -79,7 +79,7 @@ impl<'a> Event<'a, CandidatesContent<'a>> for Candidates<'a> {
} }
} }
impl<'a> RoomEvent<'a, CandidatesContent<'a>> for Candidates<'a> { impl<'a> RoomEvent<'a, CandidatesEventContent<'a>> for CandidatesEvent<'a> {
fn event_id(&'a self) -> &'a str { fn event_id(&'a self) -> &'a str {
&self.event_id &self.event_id
} }
@ -93,8 +93,8 @@ impl<'a> RoomEvent<'a, CandidatesContent<'a>> for Candidates<'a> {
} }
} }
/// The payload of a `Candidates` event. /// The payload of a `CandidatesEvent`.
pub struct CandidatesContent<'a> { pub struct CandidatesEventContent<'a> {
/// The ID of the call this event relates to. /// The ID of the call this event relates to.
call_id: &'a str, call_id: &'a str,
/// A list of candidates. /// A list of candidates.
@ -115,15 +115,15 @@ pub struct Candidate<'a> {
/// Sent by either party to signal their termination of the call. This can be sent either once the /// Sent by either party to signal their termination of the call. This can be sent either once the
/// call has has been established or before to abort the call. /// call has has been established or before to abort the call.
pub struct Hangup<'a> { pub struct HangupEvent<'a> {
content: HangupContent<'a>, content: HangupEventContent<'a>,
event_id: &'a str, event_id: &'a str,
room_id: &'a str, room_id: &'a str,
user_id: &'a str, user_id: &'a str,
} }
impl<'a> Event<'a, HangupContent<'a>> for Hangup<'a> { impl<'a> Event<'a, HangupEventContent<'a>> for HangupEvent<'a> {
fn content(&'a self) -> &'a HangupContent { fn content(&'a self) -> &'a HangupEventContent {
&self.content &self.content
} }
@ -132,7 +132,7 @@ impl<'a> Event<'a, HangupContent<'a>> for Hangup<'a> {
} }
} }
impl<'a> RoomEvent<'a, HangupContent<'a>> for Hangup<'a> { impl<'a> RoomEvent<'a, HangupEventContent<'a>> for HangupEvent<'a> {
fn event_id(&'a self) -> &'a str { fn event_id(&'a self) -> &'a str {
&self.event_id &self.event_id
} }
@ -146,8 +146,8 @@ impl<'a> RoomEvent<'a, HangupContent<'a>> for Hangup<'a> {
} }
} }
/// The payload of a `Hangup` event. /// The payload of a `HangupEvent`.
pub struct HangupContent<'a> { pub struct HangupEventContent<'a> {
/// The ID of the call this event relates to. /// The ID of the call this event relates to.
call_id: &'a str, call_id: &'a str,
/// The version of the VoIP specification this messages adheres to. /// The version of the VoIP specification this messages adheres to.
@ -155,15 +155,15 @@ pub struct HangupContent<'a> {
} }
/// This event is sent by the caller when they wish to establish a call. /// This event is sent by the caller when they wish to establish a call.
pub struct Invite<'a> { pub struct InviteEvent<'a> {
content: InviteContent<'a>, content: InviteEventContent<'a>,
event_id: &'a str, event_id: &'a str,
room_id: &'a str, room_id: &'a str,
user_id: &'a str, user_id: &'a str,
} }
impl<'a> Event<'a, InviteContent<'a>> for Invite<'a> { impl<'a> Event<'a, InviteEventContent<'a>> for InviteEvent<'a> {
fn content(&'a self) -> &'a InviteContent { fn content(&'a self) -> &'a InviteEventContent {
&self.content &self.content
} }
@ -172,7 +172,7 @@ impl<'a> Event<'a, InviteContent<'a>> for Invite<'a> {
} }
} }
impl<'a> RoomEvent<'a, InviteContent<'a>> for Invite<'a> { impl<'a> RoomEvent<'a, InviteEventContent<'a>> for InviteEvent<'a> {
fn event_id(&'a self) -> &'a str { fn event_id(&'a self) -> &'a str {
&self.event_id &self.event_id
} }
@ -186,8 +186,8 @@ impl<'a> RoomEvent<'a, InviteContent<'a>> for Invite<'a> {
} }
} }
/// The payload of an `Invite` event. /// The payload of an `InviteEvent`.
pub struct InviteContent<'a> { pub struct InviteEventContent<'a> {
/// A unique identifer for the call. /// A unique identifer for the call.
call_id: &'a str, call_id: &'a str,
/// The time in milliseconds that the invite is valid for. Once the invite age exceeds this /// The time in milliseconds that the invite is valid for. Once the invite age exceeds this

View File

@ -3,13 +3,13 @@
use core::Event; use core::Event;
/// Informs the client of a user's presence state change. /// Informs the client of a user's presence state change.
pub struct Presence<'a> { pub struct PresenceEvent<'a> {
content: PresenceContent<'a>, content: PresenceEventContent<'a>,
event_id: &'a str, event_id: &'a str,
} }
impl<'a> Event<'a, PresenceContent<'a>> for Presence<'a> { impl<'a> Event<'a, PresenceEventContent<'a>> for PresenceEvent<'a> {
fn content(&'a self) -> &'a PresenceContent { fn content(&'a self) -> &'a PresenceEventContent {
&self.content &self.content
} }
@ -18,8 +18,8 @@ impl<'a> Event<'a, PresenceContent<'a>> for Presence<'a> {
} }
} }
/// The payload of a `Presence` event. /// The payload of a `PresenceEvent`.
pub struct PresenceContent<'a> { pub struct PresenceEventContent<'a> {
/// The current avatar URL for this user. /// The current avatar URL for this user.
avatar_url: Option<&'a str>, avatar_url: Option<&'a str>,
/// The current display name for this user. /// The current display name for this user.

View File

@ -3,15 +3,15 @@
use core::Event; use core::Event;
/// Informs the client of the list of users currently typing. /// Informs the client of the list of users currently typing.
pub struct Typing<'a> { pub struct TypingEvent<'a> {
/// The payload. /// The payload.
content: TypingContent<'a>, content: TypingEventContent<'a>,
/// The ID of the room associated with this event. /// The ID of the room associated with this event.
room_id: &'a str, room_id: &'a str,
} }
impl<'a> Event<'a, TypingContent<'a>> for Typing<'a> { impl<'a> Event<'a, TypingEventContent<'a>> for TypingEvent<'a> {
fn content(&'a self) -> &'a TypingContent<'a> { fn content(&'a self) -> &'a TypingEventContent<'a> {
&self.content &self.content
} }
@ -20,8 +20,8 @@ impl<'a> Event<'a, TypingContent<'a>> for Typing<'a> {
} }
} }
/// The payload of a `Typing` event. /// The payload of a `TypingEvent`.
pub struct TypingContent<'a> { pub struct TypingEventContent<'a> {
/// The list of user IDs typing in this room, if any. /// The list of user IDs typing in this room, if any.
user_ids: &'a[&'a str], user_ids: &'a[&'a str],
} }