[][src]Struct xmpp_parsers::websocket::Open

pub struct Open {
    pub from: Option<BareJid>,
    pub to: Option<BareJid>,
    pub id: Option<String>,
    pub version: Option<String>,
    pub xml_lang: Option<String>,
}

The stream opening for WebSocket.

Fields

from: Option<BareJid>

The JID of the entity opening this stream.

to: Option<BareJid>

The JID of the entity receiving this stream opening.

id: Option<String>

The id of the stream, used for authentication challenges.

version: Option<String>

The XMPP version used during this stream.

xml_lang: Option<String>

The default human language for all subsequent stanzas, which will be transmitted to other entities for better localisation.

Methods

impl Open[src]

pub fn new(to: BareJid) -> Open[src]

Creates a simple client→server <open/> element.

pub fn with_from(self, from: BareJid) -> Open[src]

Sets the @from attribute on this <open/> element.

pub fn with_id(self, id: String) -> Open[src]

Sets the @id attribute on this <open/> element.

pub fn with_lang(self, xml_lang: String) -> Open[src]

Sets the @xml:lang attribute on this <open/> element.

pub fn is_version(&self, version: &str) -> bool[src]

Checks whether the version matches the expected one.

Trait Implementations

impl From<Open> for Element[src]

impl Clone for Open[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Open[src]

impl TryFrom<Element> for Open[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl Unpin for Open

impl Sync for Open

impl Send for Open

impl RefUnwindSafe for Open

impl UnwindSafe for Open

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[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<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> IntoElements for T where
    T: Into<Element>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self