2026-04-13 00:27:30 +02:00
|
|
|
use rnex_core::rmc::protocols::datastore::DataStore;
|
2026-04-13 00:36:12 +02:00
|
|
|
use crate::define_rmc_proto;
|
2026-04-13 00:27:30 +02:00
|
|
|
// use macros::rmc_struct;
|
|
|
|
|
use rnex_core::prudp::socket_addr::PRUDPSockAddr;
|
|
|
|
|
use std::sync::{Weak};
|
|
|
|
|
use rnex_core::PID;
|
|
|
|
|
use crate::nex::remote_console::RemoteConsole;
|
|
|
|
|
use rnex_core::rmc::response::ErrorCode;
|
|
|
|
|
use rnex_core::rmc::protocols::datastore::{GetMetaInfo, GetMetaParam};
|
|
|
|
|
|
2026-04-13 00:36:12 +02:00
|
|
|
define_rmc_proto!(
|
|
|
|
|
proto DataStoreUser {
|
|
|
|
|
DataStore
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
pub struct DataStoreUser {
|
2026-04-13 00:27:30 +02:00
|
|
|
pub pid: PID,
|
|
|
|
|
pub ip: PRUDPSockAddr,
|
2026-04-13 00:36:12 +02:00
|
|
|
pub this: Weak<DataStoreUser>,
|
2026-04-13 00:27:30 +02:00
|
|
|
pub remote: RemoteConsole,
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 00:36:12 +02:00
|
|
|
impl DataStore for DataStoreUser {
|
2026-04-13 00:30:10 +02:00
|
|
|
async fn get_meta(&self, metaparam: GetMetaParam) -> Result<GetMetaInfo, ErrorCode> {
|
2026-04-13 00:27:30 +02:00
|
|
|
// // bogus
|
|
|
|
|
// let info: GetMetaInfo = GetMetaInfo {
|
|
|
|
|
// dataid: 10,
|
|
|
|
|
// owner: 1121,
|
|
|
|
|
// size: 1024,
|
|
|
|
|
// name: "idk"
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// just trying to see what methods it tries to use
|
2026-04-13 00:30:10 +02:00
|
|
|
Err(ErrorCode::DataStore_NotFound)
|
2026-04-13 00:27:30 +02:00
|
|
|
}
|
|
|
|
|
}
|