pub struct SyncProtocol { /* private fields */ }Expand description
Sync protocol handler
Manages the state machine for sync operations over BLE GATT.
Implementations§
Source§impl SyncProtocol
impl SyncProtocol
Sourcepub fn state(&self) -> SyncProtocolState
pub fn state(&self) -> SyncProtocolState
Get current state
Sourcepub fn start_sync(&mut self, sync_vector: Vec<u8>)
pub fn start_sync(&mut self, sync_vector: Vec<u8>)
Start a sync session
Sourcepub fn queue_document(&mut self, doc_data: Vec<u8>)
pub fn queue_document(&mut self, doc_data: Vec<u8>)
Queue a document to send
Sourcepub fn next_outgoing(&mut self) -> Option<SyncMessage>
pub fn next_outgoing(&mut self) -> Option<SyncMessage>
Get next message to send
Sourcepub fn has_outgoing(&self) -> bool
pub fn has_outgoing(&self) -> bool
Check if there are messages to send
Sourcepub fn process_incoming(
&mut self,
data: &[u8],
) -> Option<(SyncMessageType, Vec<u8>)>
pub fn process_incoming( &mut self, data: &[u8], ) -> Option<(SyncMessageType, Vec<u8>)>
Process an incoming message
Returns the reassembled payload if a complete message was received.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncProtocol
impl RefUnwindSafe for SyncProtocol
impl Send for SyncProtocol
impl Sync for SyncProtocol
impl Unpin for SyncProtocol
impl UnwindSafe for SyncProtocol
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