pub struct IoTScapeServiceAsync<SocketType: SocketTraitAsync = UdpSocket> {
pub definition: ServiceDefinition,
pub name: String,
pub next_msg_id: AtomicU64,
pub rx_queue: Arc<Mutex<VecDeque<Request>>>,
pub tx_queue: Arc<Mutex<VecDeque<Response>>>,
pub client: Client,
/* private fields */
}
Fields§
§definition: ServiceDefinition
§name: String
§next_msg_id: AtomicU64
§rx_queue: Arc<Mutex<VecDeque<Request>>>
§tx_queue: Arc<Mutex<VecDeque<Response>>>
§client: Client
Implementations§
Source§impl<SocketType: SocketTraitAsync> IoTScapeServiceAsync<SocketType>
impl<SocketType: SocketTraitAsync> IoTScapeServiceAsync<SocketType>
pub async fn new( name: &str, definition: ServiceDefinition, server: SocketAddr, ) -> Self
Sourcepub async fn announce(&self) -> Result<usize, Error>
pub async fn announce(&self) -> Result<usize, Error>
Send the service description to the server
Sourcepub async fn announce_lite(&self) -> Result<usize, Error>
pub async fn announce_lite(&self) -> Result<usize, Error>
Announce without full definition
pub async fn announce_http(&self, endpoint: &str) -> Result<Response, Error>
Sourcepub async fn enqueue_response_to(
&self,
request: Request,
params: Result<Vec<Value>, String>,
) -> Result<usize, Error>
pub async fn enqueue_response_to( &self, request: Request, params: Result<Vec<Value>, String>, ) -> Result<usize, Error>
Create a response to an Request and enqueue it for sending
Auto Trait Implementations§
impl<SocketType = UdpSocket> !Freeze for IoTScapeServiceAsync<SocketType>
impl<SocketType = UdpSocket> !RefUnwindSafe for IoTScapeServiceAsync<SocketType>
impl<SocketType> Send for IoTScapeServiceAsync<SocketType>
impl<SocketType> Sync for IoTScapeServiceAsync<SocketType>
impl<SocketType> Unpin for IoTScapeServiceAsync<SocketType>
impl<SocketType = UdpSocket> !UnwindSafe for IoTScapeServiceAsync<SocketType>
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