Skip to main content

Stanza

Enum Stanza 

Source
pub enum Stanza {
    Iq(Iq),
    Message(Message),
    Presence(Presence),
}
Expand description

A stanza sent/received over the stream.

Variants§

§

Iq(Iq)

IQ stanza

§

Message(Message)

Message stanza

§

Presence(Presence)

Presence stanza

Trait Implementations§

Source§

impl AsXml for Stanza

Source§

type ItemIter<'xso_proc_as_xml_iter_lifetime> = StanzaAsXmlIterator<'xso_proc_as_xml_iter_lifetime>

The iterator type. Read more
Source§

fn as_xml_iter(&self) -> Result<Self::ItemIter<'_>, Error>

Return an iterator which emits the contents of the struct or enum as serialisable Item items.
Source§

fn as_xml_dyn_iter<'x>( &'x self, ) -> Result<Box<dyn Iterator<Item = Result<Item<'x>, Error>> + 'x>, Error>

Return the same iterator as as_xml_iter, but boxed to erase the concrete iterator type. Read more
Source§

impl Debug for Stanza

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Stanza> for Element

Source§

fn from(other: &Stanza) -> Self

Converts to this type from the input type.
Source§

impl From<Iq> for Stanza

Source§

fn from(other: Iq) -> Self

Converts to this type from the input type.
Source§

impl From<Message> for Stanza

Source§

fn from(other: Message) -> Self

Converts to this type from the input type.
Source§

impl From<Presence> for Stanza

Source§

fn from(other: Presence) -> Self

Converts to this type from the input type.
Source§

impl From<Stanza> for Element

Source§

fn from(other: Stanza) -> Self

Converts to this type from the input type.
Source§

impl FromXml for Stanza

Source§

type Builder = StanzaFromXmlBuilder

A builder type used to construct the element. Read more
Source§

fn from_events( name: QName, attrs: AttrMap, ctx: &Context<'_>, ) -> Result<Self::Builder, FromEventsError>

Attempt to initiate the streamed construction of this struct from XML. Read more
Source§

fn xml_name_matcher() -> XmlNameMatcher<'static>

Return a predicate which determines if Self may be parsed from a given XML element. Read more
Source§

impl PartialEq for Stanza

Source§

fn eq(&self, other: &Stanza) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Stanza

Source§

impl TryFrom<Element> for Stanza

Source§

type Error = FromElementError

The type returned in the event of a conversion error.
Source§

fn try_from(other: Element) -> Result<Self, FromElementError>

Performs the conversion.
Source§

impl TryFrom<Stanza> for Iq

Source§

type Error = Stanza

The type returned in the event of a conversion error.
Source§

fn try_from(other: Stanza) -> Result<Self, Stanza>

Performs the conversion.
Source§

impl TryFrom<Stanza> for Message

Source§

type Error = Stanza

The type returned in the event of a conversion error.
Source§

fn try_from(other: Stanza) -> Result<Self, Stanza>

Performs the conversion.
Source§

impl TryFrom<Stanza> for Presence

Source§

type Error = Stanza

The type returned in the event of a conversion error.
Source§

fn try_from(other: Stanza) -> Result<Self, Stanza>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsXmlDyn for T
where T: AsXml,

Source§

fn as_xml_dyn_iter<'x>( &'x self, ) -> Result<Box<dyn Iterator<Item = Result<Item<'x>, Error>> + 'x>, Error>

Return an iterator which emits the contents of the struct or enum as serialisable Item items by calling AsXml::as_xml_dyn_iter.

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.