Rename package to ruma-common and namespace event types.

This commit is contained in:
Jimmy Cuadra 2016-06-20 22:47:51 -07:00
parent 4043de42ee
commit dd1a3979e6
28 changed files with 46 additions and 44 deletions

View File

@ -1,15 +1,15 @@
[package] [package]
authors = ["Jimmy Cuadra <jimmy@jimmycuadra.com>"] authors = ["Jimmy Cuadra <jimmy@jimmycuadra.com>"]
description = "Serializable types for the events in the Matrix specification." description = "Types shared by ruma and ruma-client."
documentation = "http://ruma.github.io/ruma-events/ruma-events" documentation = "http://ruma.github.io/ruma-common/ruma_common"
homepage = "https://github.com/ruma/ruma-events" homepage = "https://github.com/ruma/ruma-events"
keywords = ["matrix", "matrix.org", "chat", "messaging", "ruma"] keywords = ["matrix", "matrix.org", "chat", "messaging", "ruma"]
license = "MIT" license = "MIT"
name = "ruma-events" name = "ruma-common"
readme = "README.md" readme = "README.md"
repository = "https://github.com/ruma/ruma-events" repository = "https://github.com/ruma/ruma-common"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
serde = "0.7.7" serde = "0.7.10"
serde_macros = "0.7.7" serde_macros = "0.7.10"

View File

@ -1,6 +1,6 @@
# ruma-events # ruma-common
ruma-events contains serializable types for the events in the [Matrix](https://matrix.org/) specification that can be shared by client and server code. **ruma-common** contains serializable types for the events and APIs in the [Matrix](https://matrix.org/) client-server specification that can be shared by client and server code.
## Status ## Status

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.answer* event. //! Types for the *m.call.answer* event.
use core::EventType; use events::EventType;
use super::SessionDescription; use super::SessionDescription;
/// 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.

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.candidates* event. //! Types for the *m.call.candidates* event.
use core::EventType; use events::EventType;
/// 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.

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.hangup* event. //! Types for the *m.call.hangup* event.
use core::EventType; use events::EventType;
/// 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.

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.invite* event. //! Types for the *m.call.invite* event.
use core::EventType; use events::EventType;
use super::SessionDescription; use super::SessionDescription;
/// 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.

View File

@ -1,9 +1,16 @@
//! Types for the basic kinds of events. //! Event types.
use room::avatar::AvatarEventContent; pub mod call;
use room::canonical_alias::CanonicalAliasEventContent; pub mod presence;
use room::join_rules::JoinRulesEventContent; pub mod receipt;
use room::name::NameEventContent; pub mod room;
pub mod tag;
pub mod typing;
use self::room::avatar::AvatarEventContent;
use self::room::canonical_alias::CanonicalAliasEventContent;
use self::room::join_rules::JoinRulesEventContent;
use self::room::name::NameEventContent;
/// The type of an event. /// The type of an event.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.presence* event. //! Types for the *m.presence* event.
use core::EventType; use events::EventType;
/// Informs the client of a user's presence state change. /// Informs the client of a user's presence state change.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -2,7 +2,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use core::EventType; use events::EventType;
/// Informs the client of new receipts. /// Informs the client of new receipts.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.aliases* event. //! Types for the *m.room.aliases* event.
use core::EventType; use events::EventType;
/// Informs the room about what room aliases it has been given. /// Informs the room about what room aliases it has been given.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.avatar* event. //! Types for the *m.room.avatar* event.
use core::EventType; use events::EventType;
use super::ImageInfo; use super::ImageInfo;
/// A picture that is associated with the room. /// A picture that is associated with the room.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.canonical_alias* event. //! Types for the *m.room.canonical_alias* event.
use core::EventType; use events::EventType;
/// Informs the room as to which alias is the canonical one. /// Informs the room as to which alias is the canonical one.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.create* event. //! Types for the *m.room.create* event.
use core::EventType; use events::EventType;
/// This is the first event in a room and cannot be changed. It acts as the root of all other /// This is the first event in a room and cannot be changed. It acts as the root of all other
/// events. /// events.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.guest_access* event. //! Types for the *m.room.guest_access* event.
use core::EventType; use events::EventType;
/// Controls whether guest users are allowed to join rooms. /// Controls whether guest users are allowed to join rooms.
/// ///

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.history_visibility* event. //! Types for the *m.room.history_visibility* event.
use core::EventType; use events::EventType;
/// This event controls whether a member of a room can see the events that happened in a room from /// This event controls whether a member of a room can see the events that happened in a room from
/// before they joined. /// before they joined.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.join_rules* event. //! Types for the *m.room.join_rules* event.
use core::EventType; use events::EventType;
/// Describes how users are allowed to join the room. /// Describes how users are allowed to join the room.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.member* event. //! Types for the *m.room.member* event.
use core::{EventType, StrippedState}; use events::{EventType, StrippedState};
/// The current membership state of a user in the room. /// The current membership state of a user in the room.
/// ///

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.message* event. //! Types for the *m.room.message* event.
use core::EventType; use events::EventType;
use super::ImageInfo; use super::ImageInfo;
/// A message sent to a room. /// A message sent to a room.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.name* event. //! Types for the *m.room.name* event.
use core::EventType; use events::EventType;
/// A human-friendly room name designed to be displayed to the end-user. /// A human-friendly room name designed to be displayed to the end-user.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -2,7 +2,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use core::EventType; use events::EventType;
/// Defines the power levels (privileges) of users in the room. /// Defines the power levels (privileges) of users in the room.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.avatar* event. //! Types for the *m.room.avatar* event.
use core::EventType; use events::EventType;
/// A redaction of an event. /// A redaction of an event.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.third_party_invite* event. //! Types for the *m.room.third_party_invite* event.
use core::EventType; use events::EventType;
/// An invitation to a room issued to a third party identifier, rather than a matrix user ID. /// An invitation to a room issued to a third party identifier, rather than a matrix user ID.
/// ///

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.topic* event. //! Types for the *m.room.topic* event.
use core::EventType; use events::EventType;
/// A topic is a short message detailing what is currently being discussed in the room. /// A topic is a short message detailing what is currently being discussed in the room.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -2,7 +2,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use core::EventType; use events::EventType;
/// Informs the client of tags on a room. /// Informs the client of tags on a room.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
//! Types for the *m.typing* event. //! Types for the *m.typing* event.
use core::EventType; use events::EventType;
/// Informs the client of the list of users currently typing. /// Informs the client of the list of users currently typing.
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]

View File

@ -1,13 +1,8 @@
//! Crate ruma_events contains serializable types for the events in the [Matrix](https://matrix.org) //! Crate ruma_common contains serializable types for the events and APIs in the
//! specification that can be shared by client and server code. //! [Matrix](https://matrix.org) client-server specification that can be shared by client and
//! server code.
#![feature(custom_derive, plugin)] #![feature(custom_derive, plugin)]
#![plugin(serde_macros)] #![plugin(serde_macros)]
pub mod call; pub mod events;
pub mod core;
pub mod presence;
pub mod receipt;
pub mod room;
pub mod tag;
pub mod typing;