Struct ssp_server::Server
source · pub struct Server {
pub handle: Arc<Mutex<DeviceHandle>>,
/* private fields */
}Expand description
SSP/eSSP server for communicating with supported device over serial.
Optionally, can be used interactively with a client connection.
Fields§
§handle: Arc<Mutex<DeviceHandle>>Implementations§
source§impl Server
impl Server
sourcepub fn new_auto(
serial_path: &str,
stop_polling: Arc<AtomicBool>,
protocol_version: ProtocolVersion
) -> Result<Self>
pub fn new_auto( serial_path: &str, stop_polling: Arc<AtomicBool>, protocol_version: ProtocolVersion ) -> Result<Self>
Creates a new Server that automatically handles device events.
sourcepub fn new_uds(
serial_path: &str,
socket_path: &str,
stop_polling: Arc<AtomicBool>,
protocol_version: ProtocolVersion,
encrypt: bool
) -> Result<Self>
Available on crate feature jsonrpc only.
pub fn new_uds( serial_path: &str, socket_path: &str, stop_polling: Arc<AtomicBool>, protocol_version: ProtocolVersion, encrypt: bool ) -> Result<Self>
jsonrpc only.Creates a new Server that interactively handles device events via a client connects over Unix domain sockets.
sourcepub fn handle(&self) -> Result<MutexGuard<'_, DeviceHandle>>
pub fn handle(&self) -> Result<MutexGuard<'_, DeviceHandle>>
Gets a reference to the DeviceHandle.
sourcepub fn lock_handle(
handle: &Arc<Mutex<DeviceHandle>>
) -> Result<MutexGuard<'_, DeviceHandle>>
pub fn lock_handle( handle: &Arc<Mutex<DeviceHandle>> ) -> Result<MutexGuard<'_, DeviceHandle>>
Aquires a lock on the DeviceHandle.
Returns an Err(_) if the timeout expires before acquiring the lock.
sourcepub fn push_queue(&self) -> Result<&PushEventReceiver>
pub fn push_queue(&self) -> Result<&PushEventReceiver>
Gets a reference to the push event queue.
Returns Err(_) if the PushEventReceiver is unset.
sourcepub fn push_queue_mut(&mut self) -> Result<&mut PushEventReceiver>
pub fn push_queue_mut(&mut self) -> Result<&mut PushEventReceiver>
Gets a mutable reference to the push event queue.
Returns Err(_) if the PushEventReceiver is unset.
sourcepub fn listener(&self) -> Result<&UnixListener>
pub fn listener(&self) -> Result<&UnixListener>
sourcepub fn listener_mut(&mut self) -> Result<&mut UnixListener>
pub fn listener_mut(&mut self) -> Result<&mut UnixListener>
Gets a mutable reference to the push event queue.
Returns Err(_) if the PushEventReceiver is unset.
pub fn accept(&mut self, stop: Arc<AtomicBool>) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl Send for Server
impl !Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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