Struct buttplug::server::ButtplugServerBuilder

source ·
pub struct ButtplugServerBuilder { /* private fields */ }
Expand description

Configures and creates ButtplugServer instances.

Implementations§

source§

impl ButtplugServerBuilder

source

pub fn name(&mut self, name: &str) -> &mut Self

Set the name of the server, which is relayed to the client on connection (mostly for confirmation in UI dialogs)

source

pub fn max_ping_time(&mut self, ping_time: u32) -> &mut Self

Set the maximum ping time, in milliseconds, for the server. If the server does not receive a Ping message in this amount of time after the handshake has succeeded, the server will automatically disconnect. If this is not called, the ping timer will not be activated.

Note that this has nothing to do with communication medium specific pings, like those built into the Websocket protocol. This ping is specific to the Buttplug protocol.

source

pub fn device_configuration_json( &mut self, config_json: Option<String> ) -> &mut Self

Set the device configuration json file contents, to be loaded during build.

source

pub fn user_device_configuration_json( &mut self, config_json: Option<String> ) -> &mut Self

Set the user device configuration json file contents, to be loaded during build.

source

pub fn comm_manager<T>(&mut self, builder: T) -> &mut Self

source

pub fn allowed_address(&mut self, address: &str) -> &mut Self

source

pub fn denied_address(&mut self, address: &str) -> &mut Self

source

pub fn reserved_index( &mut self, identifier: &ServerDeviceIdentifier, index: u32 ) -> &mut Self

source

pub fn protocol_factory<T>(&mut self, factory: T) -> &mut Self
where T: ProtocolIdentifierFactory + 'static,

source

pub fn communication_specifier( &mut self, protocol_name: &str, specifier: ProtocolCommunicationSpecifier ) -> &mut Self

source

pub fn protocol_attributes( &mut self, identifier: ProtocolAttributesIdentifier, attributes: ProtocolDeviceAttributes ) -> &mut Self

source

pub fn skip_default_protocols(&mut self) -> &mut Self

source

pub fn allow_raw_messages(&mut self) -> &mut Self

source

pub fn finish(&mut self) -> Result<ButtplugServer, ButtplugServerError>

Try to build a ButtplugServer using the parameters given.

Trait Implementations§

source§

impl Default for ButtplugServerBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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, 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