pub struct ButtplugServer { /* private fields */ }Expand description
The server side of the Buttplug protocol. Frontend for connection to device management and communication.
Implementations§
Source§impl ButtplugServer
impl ButtplugServer
pub fn client_name(&self) -> Option<String>
pub fn spec_version(&self) -> Option<ButtplugMessageSpecVersion>
Sourcepub fn connection_state(&self) -> ConnectionState
pub fn connection_state(&self) -> ConnectionState
Returns the current connection state.
Sourcepub fn event_stream(
&self,
) -> impl Stream<Item = ButtplugServerMessageVariant> + use<>
pub fn event_stream( &self, ) -> impl Stream<Item = ButtplugServerMessageVariant> + use<>
Retreive an async stream of ButtplugServerMessages. This is how the server sends out non-query-related updates to the system, including information on devices being added/removed, client disconnection, etc…
Sourcepub fn server_version_event_stream(
&self,
) -> impl Stream<Item = ButtplugServerMessageV4> + use<>
pub fn server_version_event_stream( &self, ) -> impl Stream<Item = ButtplugServerMessageV4> + use<>
Retreive an async stream of ButtplugServerMessages, always at the latest available message spec. This is how the server sends out non-query-related updates to the system, including information on devices being added/removed, client disconnection, etc…
Sourcepub fn device_manager(&self) -> Arc<ServerDeviceManager>
pub fn device_manager(&self) -> Arc<ServerDeviceManager>
Returns a references to the internal device manager, for handling configuration.
Sourcepub fn disconnect(&self) -> BoxFuture<'_, Result<(), ErrorV0>>
pub fn disconnect(&self) -> BoxFuture<'_, Result<(), ErrorV0>>
Disconnects the server from a client, if it is connected.
pub fn shutdown(&self) -> ButtplugServerResultFuture
Sourcepub fn parse_message(
&self,
msg: ButtplugClientMessageVariant,
) -> BoxFuture<'static, Result<ButtplugServerMessageVariant, ButtplugServerMessageVariant>>
pub fn parse_message( &self, msg: ButtplugClientMessageVariant, ) -> BoxFuture<'static, Result<ButtplugServerMessageVariant, ButtplugServerMessageVariant>>
Sends a [ButtplugClientMessage] to be parsed by the server (for handshake or ping), or passed into the server’s [DeviceManager] for communication with devices.