pub struct DataStoreWrite {
pub busy: bool,
pub done: bool,
pub error: bool,
pub error_message: String,
/* private fields */
}Expand description
Function block for writing a file to the DataStore.
Fields§
§busy: boolTrue while waiting for a response from the datastore.
done: boolTrue when the write operation finishes successfully. Stays true until reset or restarted.
error: boolTrue if the operation failed.
error_message: StringError description (empty when no error).
Implementations§
Source§impl DataStoreWrite
impl DataStoreWrite
Sourcepub fn start(
&mut self,
path: &str,
data: Value,
options: Value,
client: &mut CommandClient,
)
pub fn start( &mut self, path: &str, data: Value, options: Value, client: &mut CommandClient, )
Start a new file write to the DataStore.
§Arguments
path- The path to the file relative to the datastore root (e.g.,"config.json").data- The JSON payload to save to the file.options- Write options, such as{"create_dirs": true}.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 write state machine.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataStoreWrite
impl RefUnwindSafe for DataStoreWrite
impl Send for DataStoreWrite
impl Sync for DataStoreWrite
impl Unpin for DataStoreWrite
impl UnsafeUnpin for DataStoreWrite
impl UnwindSafe for DataStoreWrite
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