pub struct Driver<C: RecordCodec> {
pub core: MessengerCore<C>,
pub http_trace: Vec<(OutgoingRequestKind, u16)>,
pub security_alerts: Vec<String>,
/* private fields */
}Fields§
§core: MessengerCore<C>§http_trace: Vec<(OutgoingRequestKind, u16)>Kind and status of calls made. No bodies.
security_alerts: Vec<String>Peer device key changes seen on /keys/query.
Implementations§
Source§impl<C: RecordCodec> Driver<C>
impl<C: RecordCodec> Driver<C>
pub fn new( core: MessengerCore<C>, backend: Arc<dyn Backend>, persist: Persist<C>, ) -> Self
pub fn backend(&self) -> &Arc<dyn Backend> ⓘ
Sourcepub fn set_backend(&mut self, backend: Arc<dyn Backend>)
pub fn set_backend(&mut self, backend: Arc<dyn Backend>)
Puts another transport under the same core (the shell’s in-process bus does this).
pub fn sync_inflight(&self) -> bool
pub fn persist(&mut self) -> Result<()>
Sourcepub fn abandon_sync(&mut self, now_ms: i64)
pub fn abandon_sync(&mut self, now_ms: i64)
Drops a sync that is still on the wire (its answer is never read).
pub fn release_after_flush( &mut self, now_ms: i64, ) -> Result<Vec<OutgoingRequest>>
pub fn roundtrip( &mut self, request: &OutgoingRequest, now_ms: i64, ) -> Result<()>
pub fn spawn_sync(&mut self, request: OutgoingRequest) -> Result<()>
Sourcepub fn harvest_sync(&mut self, now_ms: i64, wait: bool) -> Result<bool>
pub fn harvest_sync(&mut self, now_ms: i64, wait: bool) -> Result<bool>
Ok(true) only when this call blocked on a poll that had not already finished. An
already-buffered answer is Ok(false).
Sourcepub fn step(
&mut self,
now_ms: i64,
wait_for_sync: bool,
waited: &mut bool,
) -> Result<bool>
pub fn step( &mut self, now_ms: i64, wait_for_sync: bool, waited: &mut bool, ) -> Result<bool>
One round of the drive loop: what the core releases is executed, syncs on the worker, the
state persisted. Ok(false) when nothing was released (the loop is done). waited tells
whether a long poll was already waited for in this drive.
Auto Trait Implementations§
impl<C> !RefUnwindSafe for Driver<C>
impl<C> !Send for Driver<C>
impl<C> !Sync for Driver<C>
impl<C> !UnwindSafe for Driver<C>
impl<C> Freeze for Driver<C>where
MessengerCore<C>: Freeze,
Box<dyn FnMut(&mut MessengerCore<C>) -> Result<(), AgentError> + Send>: Freeze,
impl<C> Unpin for Driver<C>where
MessengerCore<C>: Unpin,
Box<dyn FnMut(&mut MessengerCore<C>) -> Result<(), AgentError> + Send>: Unpin,
impl<C> UnsafeUnpin for Driver<C>where
MessengerCore<C>: UnsafeUnpin,
Box<dyn FnMut(&mut MessengerCore<C>) -> Result<(), AgentError> + Send>: UnsafeUnpin,
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