elseware/src/entity/gateway/entitygateway.rs

81 lines
2.4 KiB
Rust

use crate::entity::account::*;
use crate::entity::character::*;
use crate::entity::item::*;
// TODO: all these Options should be Results
#[async_trait::async_trait]
pub trait EntityGateway: Send + Sync + Clone {
async fn create_user(&mut self, _user: NewUserAccountEntity) -> Option<UserAccountEntity> {
unimplemented!()
}
async fn get_user_by_id(&self, _id: UserAccountId) -> Option<UserAccountEntity> {
unimplemented!();
}
async fn get_user_by_name(&self, _username: String) -> Option<UserAccountEntity> {
unimplemented!();
}
async fn save_user(&mut self, _user: &UserAccountEntity) {
unimplemented!();
}
async fn create_user_settings(&mut self, _settings: NewUserSettingsEntity) -> Option<UserSettingsEntity> {
unimplemented!();
}
async fn get_user_settings_by_user(&self, _user: &UserAccountEntity) -> Option<UserSettingsEntity> {
unimplemented!();
}
async fn save_user_settings(&mut self, _settings: &UserSettingsEntity) {
unimplemented!();
}
async fn create_character(&mut self, _char: NewCharacterEntity) -> Option<CharacterEntity> {
unimplemented!();
}
// TODO: just make this a vec sorted by slot order?
async fn get_characters_by_user(&self, _user: &UserAccountEntity) -> [Option<CharacterEntity>; 4] {
unimplemented!();
}
async fn save_character(&mut self, _char: &CharacterEntity) {
unimplemented!();
}
async fn get_guild_card_data_by_user(&self, _user: &UserAccountEntity) -> GuildCardDataEntity {
unimplemented!();
}
async fn create_item(&mut self, _item: NewItemEntity) -> Option<ItemEntity> {
unimplemented!();
}
async fn save_item(&mut self, _item: &ItemEntity) {
unimplemented!();
}
async fn change_item_location(&mut self, _item_id: &ItemEntityId, _item_location: ItemLocation) {
unimplemented!();
}
async fn feed_mag(&mut self, _mag_item_id: &ItemEntityId, _tool_item_id: &ItemEntityId) {
unimplemented!();
}
async fn change_mag_owner(&mut self, _mag_item_id: &ItemEntityId, _character: &CharacterEntity) {
unimplemented!();
}
async fn use_mag_cell(&mut self, _mag_item_id: &ItemEntityId, _mag_cell_id: &ItemEntityId) {
unimplemented!();
}
async fn get_items_by_character(&self, _char: &CharacterEntity) -> Vec<ItemEntity> {
unimplemented!();
}
}