[][src]Struct tokio_xmpp::SimpleClient

pub struct SimpleClient { /* fields omitted */ }

A simple XMPP client connection

This implements the futures crate's Stream and Sink traits.

Implementations

impl Client[src]

pub async fn new<P: Into<String>>(jid: &str, password: P) -> Result<Self, Error>[src]

Start a new XMPP client and wait for a usable session

pub async fn new_with_jid(jid: Jid, password: String) -> Result<Self, Error>[src]

Start a new client given that the JID is already parsed.

pub fn bound_jid(&self) -> &Jid[src]

Get the client's bound JID (the one reported by the XMPP server).

pub async fn send_stanza<E>(&mut self, stanza: E) -> Result<(), Error> where
    E: Into<Element>, 
[src]

Send stanza

pub async fn end(self) -> Result<(), Error>[src]

End connection by sending </stream:stream>

You may expect the server to respond with the same. This client will then drop its connection.

Trait Implementations

impl Sink<Packet> for Client[src]

Outgoing XMPP packets

See send_stanza() for an async fn

type Error = Error

The type of value produced by the sink when an error occurs.

impl Stream for Client[src]

Incoming XMPP events

In an async fn you may want to use this with use futures::stream::StreamExt;

type Item = Result<Element, Error>

Values yielded by the stream.

pub fn poll_next(
    mut self: Pin<&mut Self>,
    cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
[src]

Low-level read on the XMPP stream

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> Same<T> for T

type Output = T

Should always be Self

impl<T, Item> SinkExt<Item> for T where
    T: Sink<Item> + ?Sized

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<St> StreamExt for St where
    St: Stream + ?Sized
[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.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,