tokio_xmpp::connect::tcp

Type Alias TcpComponent

Source
pub type TcpComponent = Component<TcpServerConnector>;
Available on crate feature insecure-tcp only.
Expand description

Component that connects over TCP

Aliased Type§

struct TcpComponent {
    pub jid: Jid,
    /* private fields */
}

Fields§

§jid: Jid

The component’s Jabber-Id

Implementations

Source§

impl<C: ServerConnector> Component<C>

Source

pub async fn send_stanza(&mut self, stanza: Stanza) -> Result<(), Error>

Send stanza

Source

pub async fn send_end(&mut self) -> Result<(), Error>

End connection

Source§

impl<C: ServerConnector> Component<C>

Source

pub async fn new_with_connector( jid: &str, password: &str, connector: C, timeouts: Timeouts, ) -> Result<Self, Error>

Start a new XMPP component.

Unfortunately StartTlsConnector is not supported yet. The tracking issue is #143.

Source§

impl Component<TcpServerConnector>

Source

pub async fn new(jid: &str, password: &str) -> Result<Self, Error>

Start a new XMPP component over plaintext TCP to localhost:5347

Source

pub async fn new_plaintext( jid: &str, password: &str, dns_config: DnsConfig, timeouts: Timeouts, ) -> Result<Self, Error>

Start a new XMPP component over plaintext TCP

Trait Implementations

Source§

impl<C: ServerConnector> Sink<Stanza> for Component<C>

Source§

type Error = Error

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

fn start_send(self: Pin<&mut Self>, item: Stanza) -> Result<(), Self::Error>

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more
Source§

fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the Sink to receive a value. Read more
Source§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from this sink. Read more
Source§

fn poll_close( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output and close this sink, if necessary. Read more
Source§

impl<C: ServerConnector> Stream for Component<C>

Source§

type Item = Stanza

Values yielded by the stream.
Source§

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

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more