[][src]Struct libstrophe::Stanza

pub struct Stanza { /* fields omitted */ }

Proxy to the underlying xmpp_stanza_t struct.

Most of the methods in this struct mimic the methods of the underlying library. So please see libstrophe docs and sources. Only where it's not the case or there is some additional logic involved then you can see the method description.

This struct implements:

Methods

impl Stanza[src]

pub fn new() -> Self[src]

xmpp_stanza_new

The newly created stanza is not really useful until you assign an internal type to it. To do that you must call set_text() to make it XMPP_STANZA_TEXT stanza or set_name() to make it XMPP_STANZA_TAG stanza.

pub fn new_presence() -> Self[src]

pub fn new_iq(typ: Option<&str>, id: Option<&str>) -> Self[src]

pub fn new_message(
    typ: Option<&str>,
    id: Option<&str>,
    to: Option<&str>
) -> Self
[src]

pub unsafe fn from_inner(inner: *mut xmpp_stanza_t) -> Self[src]

Create an owning stanza from the raw pointer, for internal use

pub unsafe fn from_inner_ref<'st>(inner: *const xmpp_stanza_t) -> StanzaRef<'st>[src]

Create a borrowing stanza from the constant raw pointer, for internal use

pub unsafe fn from_inner_ref_mut<'st>(
    inner: *mut xmpp_stanza_t
) -> StanzaMutRef<'st>
[src]

Create a borrowing stanza from the mutable raw pointer, for internal use

pub fn as_inner(&self) -> *mut xmpp_stanza_t[src]

Return internal raw pointer to stanza, for internal use

pub fn is_text(&self) -> bool[src]

pub fn is_tag(&self) -> bool[src]

pub fn to_text(&self) -> Result<String>[src]

pub fn set_name(&mut self, name: impl AsRef<str>) -> EmptyResult[src]

xmpp_stanza_set_name

Be aware that calling this method changes the internal type of stanza to XMPP_STANZA_TAG.

pub fn name(&self) -> Option<&str>[src]

pub fn attribute_count(&self) -> i32[src]

pub fn set_attribute(
    &mut self,
    name: impl AsRef<str>,
    value: impl AsRef<str>
) -> EmptyResult
[src]

pub fn get_attribute(&self, name: impl AsRef<str>) -> Option<&str>[src]

pub fn attributes(&self) -> HashMap<&str, &str>[src]

xmpp_stanza_get_attributes

This method returns data as HashMap unlike underlying function.

pub fn del_attribute(&mut self, name: impl AsRef<str>) -> EmptyResult[src]

pub fn set_text(&mut self, text: impl AsRef<str>) -> EmptyResult[src]

xmpp_stanza_set_text_with_size

Be aware that calling this method changes the internal type of stanza to XMPP_STANZA_TEXT.

pub fn text(&self) -> Option<String>[src]

pub fn set_id(&mut self, id: impl AsRef<str>) -> EmptyResult[src]

pub fn id(&self) -> Option<&str>[src]

pub fn set_ns(&mut self, ns: impl AsRef<str>) -> EmptyResult[src]

pub fn ns(&self) -> Option<&str>[src]

pub fn set_stanza_type(&mut self, typ: impl AsRef<str>) -> EmptyResult[src]

pub fn stanza_type(&self) -> Option<&str>[src]

pub fn set_to(&mut self, to: impl AsRef<str>) -> EmptyResult[src]

pub fn to(&self) -> Option<&str>[src]

pub fn set_from(&mut self, from: impl AsRef<str>) -> EmptyResult[src]

pub fn from(&self) -> Option<&str>[src]

pub fn get_first_child(&self) -> Option<StanzaRef>[src]

pub fn get_first_child_mut(&mut self) -> Option<StanzaMutRef>[src]

pub fn get_child_by_ns(&self, ns: impl AsRef<str>) -> Option<StanzaRef>[src]

pub fn get_child_by_ns_mut(
    &mut self,
    ns: impl AsRef<str>
) -> Option<StanzaMutRef>
[src]

pub fn get_child_by_name(&self, name: impl AsRef<str>) -> Option<StanzaRef>[src]

pub fn get_child_by_name_mut(
    &mut self,
    name: impl AsRef<str>
) -> Option<StanzaMutRef>
[src]

pub fn children(&self) -> impl Iterator<Item = StanzaRef>[src]

pub fn children_mut(&mut self) -> impl Iterator<Item = StanzaMutRef>[src]

pub fn get_next(&self) -> Option<StanzaRef>[src]

pub fn get_next_mut(&mut self) -> Option<StanzaMutRef>[src]

pub fn add_child(&mut self, child: Stanza) -> EmptyResult[src]

pub fn reply(&self) -> Self[src]

pub fn set_body(&mut self, body: impl AsRef<str>) -> EmptyResult[src]

pub fn body(&self) -> Option<String>[src]

Trait Implementations

impl Drop for Stanza[src]

impl PartialEq<Stanza> for Stanza[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Default for Stanza[src]

impl Clone for Stanza[src]

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

Performs copy-assignment from source. Read more

impl Eq for Stanza[src]

impl<'st> Into<StanzaRef<'st>> for Stanza[src]

impl<'st> Into<StanzaMutRef<'st>> for Stanza[src]

impl Send for Stanza[src]

impl Display for Stanza[src]

impl Debug for Stanza[src]

impl Hash for Stanza[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Sync for Stanza

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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