starting stores

This commit is contained in:
2024-02-02 17:28:58 +01:00
parent 6db9b52cb4
commit 3155243ae9

View File

@ -0,0 +1,38 @@
use crate::check_global_threading_available;
struct Store{
mutex: crate::fsrc::mutex::RawMutex
}
trait StoreBackend {
}
struct StoreAccessor {
mutex: crate::fsrc::mutex::RawMutex
}
impl Store {
pub fn get_accessor(&self) -> StoreAccessor {
check_global_threading_available!();
StoreAccessor{mutex: self.mutex.clone()}
}
}
struct StoreSlot{
data: *mut [u8]
}
impl StoreSlot {
pub fn get_data(&self) -> &[u8] {
check_global_threading_available!();
unsafe{&(*self.data)}
}
pub fn get_all_data(&self) -> &[u8] {
check_global_threading_available!();
unsafe{&(*self.data)}
}
}