[][src]Struct bluetooth_serial_port_async::BtSocket

pub struct BtSocket(_);

The bluetooth socket.

Can be used with mio::Poll.

Implementations

impl BtSocket[src]

pub fn new(protocol: BtProtocol) -> Result<BtSocket, BtError>[src]

Create an (still) unconnected socket.

pub fn connect(&mut self, addr: BtAddr) -> Result<(), BtError>[src]

Connect to the RFCOMM service on remote device with address addr. Channel will be determined through SDP protocol.

This function can block for some seconds.

pub fn connect_async(&mut self, addr: BtAddr) -> BtSocketConnect<'_>[src]

Connect to the RFCOMM service on remote device with address addr. Channel will be determined through SDP protocol.

This function will return immediately and can therefor not indicate most kinds of failures. Once the connection actually has been established or an error has been determined the socket will become writable however. It is highly recommended to combine this call with the usage of mio (or some higher level event loop) to get proper non-blocking behaviour.

pub fn get_stream_std(&self) -> StdUnixStream[src]

pub fn get_stream(&self) -> UnixStream[src]

pub fn get_fd(&self) -> i32[src]

Trait Implementations

impl Debug for BtSocket[src]

impl Evented for BtSocket[src]

impl From<BtSocket> for BtSocket[src]

impl Read for BtSocket[src]

impl Write for BtSocket[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.