pub struct ClientStompHandle<T>{ /* private fields */ }Expand description
A handle that reads and writes STOMP messages given an implementation of ClientTransport.
Implementations§
Source§impl<T> ClientStompHandle<T>
impl<T> ClientStompHandle<T>
Sourcepub async fn connect(
transport: T,
virtualhost: String,
login: Option<String>,
passcode: Option<String>,
headers: Vec<(String, String)>,
) -> Result<ClientStompHandle<T>>
pub async fn connect( transport: T, virtualhost: String, login: Option<String>, passcode: Option<String>, headers: Vec<(String, String)>, ) -> Result<ClientStompHandle<T>>
Creates a new ClientStompHandle for your code to interface with. Requires an implementation of ClientTransport.
Sourcepub async fn send_message(
&mut self,
message: Message<ToServer>,
) -> Result<(), WriteError>
pub async fn send_message( &mut self, message: Message<ToServer>, ) -> Result<(), WriteError>
Send a STOMP message through the underlying transport
Sourcepub async fn read_response(
&mut self,
) -> Result<ServerResponse<T::ProtocolSideChannel>, ReadError>
pub async fn read_response( &mut self, ) -> Result<ServerResponse<T::ProtocolSideChannel>, ReadError>
Read a STOMP message from the underlying transport
Sourcepub fn into_transport(self) -> T
pub fn into_transport(self) -> T
Consume the ClientStompHandle to get the original ClientTransport back.
Sourcepub fn as_mut_transport(&mut self) -> &mut T
pub fn as_mut_transport(&mut self) -> &mut T
Get a mutable reference to the transport, to be able to handle e.g. WebSocket Ping/Pong
Auto Trait Implementations§
impl<T> Freeze for ClientStompHandle<T>where
T: Freeze,
impl<T> RefUnwindSafe for ClientStompHandle<T>where
T: RefUnwindSafe,
impl<T> Send for ClientStompHandle<T>
impl<T> Sync for ClientStompHandle<T>
impl<T> Unpin for ClientStompHandle<T>where
T: Unpin,
impl<T> UnsafeUnpin for ClientStompHandle<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ClientStompHandle<T>where
T: 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