Enum buttplug::core::message::ButtplugServerMessage

source ·
pub enum ButtplugServerMessage {
Show 13 variants Ok(Ok), Error(Error), Test(Test), Log(Log), ServerInfo(ServerInfo), DeviceList(DeviceList), DeviceAdded(DeviceAdded), DeviceRemoved(DeviceRemoved), ScanningFinished(ScanningFinished), RawReading(RawReading), SensorReading(SensorReading), BatteryLevelReading(BatteryLevelReading), RSSILevelReading(RSSILevelReading),
}
Expand description

Represents all possible messages a ButtplugServer can send to a ButtplugClient.

Variants§

§

Ok(Ok)

§

Error(Error)

§

Test(Test)

§

Log(Log)

§

ServerInfo(ServerInfo)

§

DeviceList(DeviceList)

§

DeviceAdded(DeviceAdded)

§

DeviceRemoved(DeviceRemoved)

§

ScanningFinished(ScanningFinished)

§

RawReading(RawReading)

§

SensorReading(SensorReading)

§

BatteryLevelReading(BatteryLevelReading)

§

RSSILevelReading(RSSILevelReading)

Trait Implementations§

source§

impl ButtplugMessage for ButtplugServerMessage

source§

fn id(&self) -> u32

Returns the id number of the message
source§

fn set_id(&mut self, id: u32)

Sets the id number of the message.
source§

fn is_server_event(&self) -> bool

True if the message is an event (message id of 0) from the server.
source§

impl ButtplugMessageFinalizer for ButtplugServerMessage

source§

fn finalize(&mut self)

source§

impl ButtplugMessageValidator for ButtplugServerMessage

source§

fn is_valid(&self) -> Result<(), ButtplugMessageError>

Returns () if the message is valid, otherwise returns a message error.
source§

fn is_system_id(&self, id: u32) -> Result<(), ButtplugMessageError>

source§

fn is_not_system_id(&self, id: u32) -> Result<(), ButtplugMessageError>

source§

fn is_in_command_range( &self, value: f64, error_msg: String ) -> Result<(), ButtplugMessageError>

source§

impl Clone for ButtplugServerMessage

source§

fn clone(&self) -> ButtplugServerMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ButtplugServerMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<BatteryLevelReading> for ButtplugServerMessage

source§

fn from(msg: BatteryLevelReading) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<ButtplugServerDeviceMessage> for ButtplugServerMessage

source§

fn from(other: ButtplugServerDeviceMessage) -> Self

Converts to this type from the input type.
source§

impl From<DeviceAdded> for ButtplugServerMessage

source§

fn from(msg: DeviceAdded) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<DeviceList> for ButtplugServerMessage

source§

fn from(msg: DeviceList) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<DeviceRemoved> for ButtplugServerMessage

source§

fn from(msg: DeviceRemoved) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<Error> for ButtplugServerMessage

source§

fn from(msg: Error) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<Log> for ButtplugServerMessage

source§

fn from(msg: Log) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<Ok> for ButtplugServerMessage

source§

fn from(msg: Ok) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<RSSILevelReading> for ButtplugServerMessage

source§

fn from(msg: RSSILevelReading) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<RawReading> for ButtplugServerMessage

source§

fn from(msg: RawReading) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<ScanningFinished> for ButtplugServerMessage

source§

fn from(msg: ScanningFinished) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<SensorReading> for ButtplugServerMessage

source§

fn from(msg: SensorReading) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<ServerInfo> for ButtplugServerMessage

source§

fn from(msg: ServerInfo) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl From<Test> for ButtplugServerMessage

source§

fn from(msg: Test) -> ButtplugServerMessage

Converts to this type from the input type.
source§

impl PartialEq for ButtplugServerMessage

source§

fn eq(&self, other: &ButtplugServerMessage) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<ButtplugServerMessage> for ButtplugSpecV0ServerMessage

§

type Error = ButtplugMessageError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ButtplugServerMessage) -> Result<Self, ButtplugMessageError>

Performs the conversion.
source§

impl TryFrom<ButtplugServerMessage> for ButtplugSpecV1ServerMessage

§

type Error = ButtplugMessageError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ButtplugServerMessage) -> Result<Self, ButtplugMessageError>

Performs the conversion.
source§

impl TryFrom<ButtplugServerMessage> for ButtplugSpecV2ServerMessage

§

type Error = ButtplugMessageError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ButtplugServerMessage) -> Result<Self, ButtplugMessageError>

Performs the conversion.
source§

impl TryFrom<ButtplugServerMessage> for ButtplugSpecV3ServerMessage

§

type Error = ButtplugMessageError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ButtplugServerMessage) -> Result<Self, ButtplugMessageError>

Performs the conversion.
source§

impl ButtplugServerMessageType for ButtplugServerMessage

source§

impl StructuralPartialEq for ButtplugServerMessage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more