pub struct DataStoreRead {
pub busy: bool,
pub done: bool,
pub error: bool,
pub error_message: String,
pub data: Option<Value>,
/* private fields */
}Expand description
Function block for reading a file from the DataStore.
Fields§
§busy: boolTrue while waiting for a response from the datastore.
done: boolTrue when the read operation finishes successfully. Stays true until reset or restarted.
error: boolTrue if the operation failed.
error_message: StringError description (empty when no error).
data: Option<Value>The parsed JSON data from the file. Some after a successful read, None otherwise.
Implementations§
Source§impl DataStoreRead
impl DataStoreRead
Sourcepub fn start(&mut self, path: &str, client: &mut CommandClient)
pub fn start(&mut self, path: &str, client: &mut CommandClient)
Start a new file read from the DataStore.
§Arguments
path- The path to the file relative to the datastore root (e.g.,"config.json").client- The IPC command client.
Sourcepub fn tick(&mut self, timeout_ms: u32, client: &mut CommandClient)
pub fn tick(&mut self, timeout_ms: u32, client: &mut CommandClient)
Execute one scan cycle of the read state machine.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataStoreRead
impl RefUnwindSafe for DataStoreRead
impl Send for DataStoreRead
impl Sync for DataStoreRead
impl Unpin for DataStoreRead
impl UnsafeUnpin for DataStoreRead
impl UnwindSafe for DataStoreRead
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more