pub struct Connector<S: ToSocketAddrs, V: Into<String>> { /* private fields */ }Expand description
Create a connection to a STOMP server via TCP, including the connection handshake. If successful, returns a tuple of a message stream and a sender, which may be used to receive and send messages respectively.
virtualhost If no specific virtualhost is desired, it is recommended
to set this to the same as the host name that the socket
was established against (i.e, the same as the server address).
§Examples
use async_stomp::client::Connector;
#[tokio::main]
async fn main() {
let connection = Connector::builder()
.server("stomp.example.com")
.virtualhost("stomp.example.com")
.login("guest".to_string())
.passcode("guest".to_string())
.connect()
.await;
}Implementations§
Source§impl<S: ToSocketAddrs, V: Into<String>> Connector<S, V>
impl<S: ToSocketAddrs, V: Into<String>> Connector<S, V>
Sourcepub fn builder() -> ConnectorBuilder<S, V, ((), (), (), (), ())>
pub fn builder() -> ConnectorBuilder<S, V, ((), (), (), (), ())>
Create a builder for building Connector.
On the builder, call .server(...), .virtualhost(...), .login(...)(optional), .passcode(...)(optional), .headers(...)(optional) to set the values of the fields.
Finally, call .__build() to create the instance of Connector.
Auto Trait Implementations§
impl<S, V> Freeze for Connector<S, V>
impl<S, V> RefUnwindSafe for Connector<S, V>where
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<S, V> Send for Connector<S, V>
impl<S, V> Sync for Connector<S, V>
impl<S, V> Unpin for Connector<S, V>
impl<S, V> UnwindSafe for Connector<S, V>where
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more