Update formatting of lib.rs
This commit is contained in:
parent
eaf26fdb0b
commit
013decf401
15
src/lib.rs
15
src/lib.rs
@ -430,10 +430,12 @@ mod custom {
|
|||||||
impl Event for CustomEvent {
|
impl Event for CustomEvent {
|
||||||
/// The type of this event's `content` field.
|
/// The type of this event's `content` field.
|
||||||
type Content = CustomEventContent;
|
type Content = CustomEventContent;
|
||||||
|
|
||||||
/// The event's content.
|
/// The event's content.
|
||||||
fn content(&self) -> &Self::Content {
|
fn content(&self) -> &Self::Content {
|
||||||
&self.content
|
&self.content
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The type of the event.
|
/// The type of the event.
|
||||||
fn event_type(&self) -> EventType {
|
fn event_type(&self) -> EventType {
|
||||||
EventType::Custom(self.event_type.clone())
|
EventType::Custom(self.event_type.clone())
|
||||||
@ -493,10 +495,12 @@ mod custom_room {
|
|||||||
impl Event for CustomRoomEvent {
|
impl Event for CustomRoomEvent {
|
||||||
/// The type of this event's `content` field.
|
/// The type of this event's `content` field.
|
||||||
type Content = CustomRoomEventContent;
|
type Content = CustomRoomEventContent;
|
||||||
|
|
||||||
/// The event's content.
|
/// The event's content.
|
||||||
fn content(&self) -> &Self::Content {
|
fn content(&self) -> &Self::Content {
|
||||||
&self.content
|
&self.content
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The type of the event.
|
/// The type of the event.
|
||||||
fn event_type(&self) -> EventType {
|
fn event_type(&self) -> EventType {
|
||||||
EventType::Custom(self.event_type.clone())
|
EventType::Custom(self.event_type.clone())
|
||||||
@ -508,10 +512,12 @@ mod custom_room {
|
|||||||
fn event_id(&self) -> &ruma_identifiers::EventId {
|
fn event_id(&self) -> &ruma_identifiers::EventId {
|
||||||
&self.event_id
|
&self.event_id
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Time on originating homeserver when this event was sent.
|
/// Time on originating homeserver when this event was sent.
|
||||||
fn origin_server_ts(&self) -> SystemTime {
|
fn origin_server_ts(&self) -> SystemTime {
|
||||||
self.origin_server_ts
|
self.origin_server_ts
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The unique identifier for the room associated with this event.
|
/// The unique identifier for the room associated with this event.
|
||||||
///
|
///
|
||||||
/// This can be `None` if the event came from a context where there is
|
/// This can be `None` if the event came from a context where there is
|
||||||
@ -519,10 +525,12 @@ mod custom_room {
|
|||||||
fn room_id(&self) -> Option<&ruma_identifiers::RoomId> {
|
fn room_id(&self) -> Option<&ruma_identifiers::RoomId> {
|
||||||
self.room_id.as_ref()
|
self.room_id.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The unique identifier for the user who sent this event.
|
/// The unique identifier for the user who sent this event.
|
||||||
fn sender(&self) -> &ruma_identifiers::UserId {
|
fn sender(&self) -> &ruma_identifiers::UserId {
|
||||||
&self.sender
|
&self.sender
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Additional key-value pairs not signed by the homeserver.
|
/// Additional key-value pairs not signed by the homeserver.
|
||||||
fn unsigned(&self) -> &Map<String, Value> {
|
fn unsigned(&self) -> &Map<String, Value> {
|
||||||
&self.unsigned
|
&self.unsigned
|
||||||
@ -597,10 +605,12 @@ mod custom_state {
|
|||||||
impl Event for CustomStateEvent {
|
impl Event for CustomStateEvent {
|
||||||
/// The type of this event's `content` field.
|
/// The type of this event's `content` field.
|
||||||
type Content = CustomStateEventContent;
|
type Content = CustomStateEventContent;
|
||||||
|
|
||||||
/// The event's content.
|
/// The event's content.
|
||||||
fn content(&self) -> &Self::Content {
|
fn content(&self) -> &Self::Content {
|
||||||
&self.content
|
&self.content
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The type of the event.
|
/// The type of the event.
|
||||||
fn event_type(&self) -> EventType {
|
fn event_type(&self) -> EventType {
|
||||||
EventType::Custom(self.event_type.clone())
|
EventType::Custom(self.event_type.clone())
|
||||||
@ -612,10 +622,12 @@ mod custom_state {
|
|||||||
fn event_id(&self) -> &ruma_identifiers::EventId {
|
fn event_id(&self) -> &ruma_identifiers::EventId {
|
||||||
&self.event_id
|
&self.event_id
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Time on originating homeserver when this event was sent.
|
/// Time on originating homeserver when this event was sent.
|
||||||
fn origin_server_ts(&self) -> SystemTime {
|
fn origin_server_ts(&self) -> SystemTime {
|
||||||
self.origin_server_ts
|
self.origin_server_ts
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The unique identifier for the room associated with this event.
|
/// The unique identifier for the room associated with this event.
|
||||||
///
|
///
|
||||||
/// This can be `None` if the event came from a context where there is
|
/// This can be `None` if the event came from a context where there is
|
||||||
@ -623,10 +635,12 @@ mod custom_state {
|
|||||||
fn room_id(&self) -> Option<&ruma_identifiers::RoomId> {
|
fn room_id(&self) -> Option<&ruma_identifiers::RoomId> {
|
||||||
self.room_id.as_ref()
|
self.room_id.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The unique identifier for the user who sent this event.
|
/// The unique identifier for the user who sent this event.
|
||||||
fn sender(&self) -> &ruma_identifiers::UserId {
|
fn sender(&self) -> &ruma_identifiers::UserId {
|
||||||
&self.sender
|
&self.sender
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Additional key-value pairs not signed by the homeserver.
|
/// Additional key-value pairs not signed by the homeserver.
|
||||||
fn unsigned(&self) -> &Map<String, Value> {
|
fn unsigned(&self) -> &Map<String, Value> {
|
||||||
&self.unsigned
|
&self.unsigned
|
||||||
@ -638,6 +652,7 @@ mod custom_state {
|
|||||||
fn prev_content(&self) -> Option<&Self::Content> {
|
fn prev_content(&self) -> Option<&Self::Content> {
|
||||||
self.prev_content.as_ref()
|
self.prev_content.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A key that determines which piece of room state the event represents.
|
/// A key that determines which piece of room state the event represents.
|
||||||
fn state_key(&self) -> &str {
|
fn state_key(&self) -> &str {
|
||||||
&self.state_key
|
&self.state_key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user