forked from ROMEO/obsw
starting stores
This commit is contained in:
38
mission_rust/src/fsrc/store.rs
Normal file
38
mission_rust/src/fsrc/store.rs
Normal 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)}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user