pub struct DeviceSync { /* private fields */ }Expand description
Data synchronization
Implementations§
Source§impl DeviceSync
impl DeviceSync
Sourcepub fn new(
thread_id: u32,
shared_state: Arc<SharedDeviceState>,
sync_interval_ms: u64,
) -> Self
pub fn new( thread_id: u32, shared_state: Arc<SharedDeviceState>, sync_interval_ms: u64, ) -> Self
Create a new data synchronization
Sourcepub fn should_sync(&self) -> bool
pub fn should_sync(&self) -> bool
Check if it’s time to sync
Sourcepub fn sync(&mut self, device: &mut PoKeysDevice) -> Result<()>
pub fn sync(&mut self, device: &mut PoKeysDevice) -> Result<()>
Sync the device state
Get the shared state
Sourcepub fn sync_interval(&self) -> Duration
pub fn sync_interval(&self) -> Duration
Get the sync interval
Sourcepub fn set_sync_interval(&mut self, sync_interval_ms: u64)
pub fn set_sync_interval(&mut self, sync_interval_ms: u64)
Set the sync interval
Auto Trait Implementations§
impl Freeze for DeviceSync
impl !RefUnwindSafe for DeviceSync
impl Send for DeviceSync
impl Sync for DeviceSync
impl Unpin for DeviceSync
impl !UnwindSafe for DeviceSync
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