Struct tinkerforge::ip_connection::IpConnectionRequestSender [−][src]
pub struct IpConnectionRequestSender { /* fields omitted */ }
Expand description
The IP connection request sender is a cloneable object created by a IP connection. The sender can send requests to connected devices and can be shared across threads by cloning.
Implementations
impl IpConnectionRequestSender
[src]
impl IpConnectionRequestSender
[src]pub fn connect<T: ToSocketAddrs>(
&self,
addr: T
) -> Receiver<Result<(), ConnectError>>
[src]
pub fn connect<T: ToSocketAddrs>(
&self,
addr: T
) -> Receiver<Result<(), ConnectError>>
[src]Creates a TCP/IP connection to the given addr
. addr
can be any object which implements
ToSocketAddrs
, for example a tuple of a hostname and a port.
The address can refer to a Brick Daemon or to a WIFI/Ethernet Extension.
Devices can only be controlled when the connection was established successfully.
Returns a receiver, which will receive either ()
or an ConnectError
if there is no Brick Daemon or WIFI/Ethernet Extension listening at the given host and port.
pub fn disconnect(&self) -> Receiver<Result<(), DisconnectErrorNotConnected>>
[src]
pub fn disconnect(&self) -> Receiver<Result<(), DisconnectErrorNotConnected>>
[src]Disconnects the TCP/IP connection from the Brick Daemon or the WIFI/Ethernet Extension.
pub fn get_connect_callback_receiver(&self) -> Receiver<ConnectReason>
[src]
pub fn get_connect_callback_receiver(&self) -> Receiver<ConnectReason>
[src]This event is triggered whenever the IP Connection got connected to a Brick Daemon or to a WIFI/Ethernet Extension.
pub fn get_disconnect_callback_receiver(&self) -> Receiver<DisconnectReason>
[src]
pub fn get_disconnect_callback_receiver(&self) -> Receiver<DisconnectReason>
[src]This event is triggered whenever the IP Connection got disconnected from a Brick Daemon or to a WIFI/Ethernet Extension.
pub fn get_timeout(&self) -> Duration
[src]
pub fn get_timeout(&self) -> Duration
[src]Returns the timeout as set by set_timeout
pub fn set_timeout(&mut self, timeout: Duration)
[src]
pub fn set_timeout(&mut self, timeout: Duration)
[src]Sets the timeout for getters and for setters for which the response expected flag is activated.
Default timeout is 2,5s.
pub fn get_connection_state(&self) -> ConnectionState
[src]
pub fn get_connection_state(&self) -> ConnectionState
[src]Queries the current connection state.
pub fn get_auto_reconnect(&self) -> bool
[src]
pub fn get_auto_reconnect(&self) -> bool
[src]Returns true if auto-reconnect is enabled, false otherwise.
pub fn set_auto_reconnect(&mut self, auto_reconnect_enabled: bool)
[src]
pub fn set_auto_reconnect(&mut self, auto_reconnect_enabled: bool)
[src]Enables or disables auto-reconnect. If auto-reconnect is enabled, the IP Connection will try to reconnect to
the previously given host and port, if the currently existing connection is lost.
Therefore, auto-reconnect only does something after a successful connect
call.
Default value is true.
pub fn enumerate(&self)
[src]
pub fn enumerate(&self)
[src]Broadcasts an enumerate request. All devices will respond with an enumerate event.
pub fn get_enumerate_callback_receiver(
&self
) -> ConvertingCallbackReceiver<EnumerateResponse>
[src]
pub fn get_enumerate_callback_receiver(
&self
) -> ConvertingCallbackReceiver<EnumerateResponse>
[src]This receiver receives enumerate events, as described here.
pub fn authenticate(
&self,
secret: &str
) -> Result<ConvertingReceiver<()>, AuthenticateError>
[src]
pub fn authenticate(
&self,
secret: &str
) -> Result<ConvertingReceiver<()>, AuthenticateError>
[src]Performs an authentication handshake with the connected Brick Daemon or WIFI/Ethernet Extension. If the handshake succeeds the connection switches from non-authenticated to authenticated state and communication can continue as normal. If the handshake fails then the connection gets closed. Authentication can fail if the wrong secret was used or if authentication is not enabled at all on the Brick Daemon or the WIFI/Ethernet Extension.
See the authentication tutorial for more information.
New in version 2.1.0.
Trait Implementations
impl Clone for IpConnectionRequestSender
[src]
impl Clone for IpConnectionRequestSender
[src]fn clone(&self) -> IpConnectionRequestSender
[src]
fn clone(&self) -> IpConnectionRequestSender
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for IpConnectionRequestSender
[src]
impl Debug for IpConnectionRequestSender
[src]impl GetRequestSender for &IpConnectionRequestSender
[src]
impl GetRequestSender for &IpConnectionRequestSender
[src]fn get_rs(&self) -> IpConnectionRequestSender
[src]
Auto Trait Implementations
impl !RefUnwindSafe for IpConnectionRequestSender
impl Send for IpConnectionRequestSender
impl !Sync for IpConnectionRequestSender
impl Unpin for IpConnectionRequestSender
impl !UnwindSafe for IpConnectionRequestSender
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more