Fleshing out server

This commit is contained in:
2024-06-23 00:01:05 -04:00
Unverified
parent b34b295eb4
commit 3241f5d57a
2 changed files with 63 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ use std::net::SocketAddr;
use futures::future;
use futures::future::Ready;
use tarpc::context::Context;
use crate::types::RealmChat;
use crate::types::{Message, RealmChat, Room, SuccessCode, User};
#[derive(Clone)]
pub struct RealmChatServer(pub SocketAddr);
@@ -11,4 +11,32 @@ impl RealmChat for RealmChatServer {
fn test(self, context: Context, name: String) -> Ready<String> {
future::ready(format!("Hello, {name}!"))
}
fn send_message(self, context: Context, message: Message) -> Ready<SuccessCode> {
todo!()
}
async fn get_message_from_guid(self, context: Context, guid: String) -> Message {
todo!()
}
async fn get_rooms(self, context: Context) -> Vec<Room> {
todo!()
}
async fn get_room(self, context: Context, roomid: String) -> Room {
todo!()
}
async fn get_user(self, context: Context, userid: String) -> User {
todo!()
}
async fn get_joined_users(self, context: Context) -> Vec<User> {
todo!()
}
async fn get_online_users(self, context: Context) -> Vec<User> {
todo!()
}
}