Struct libstrophe::StanzaRef
source · pub struct StanzaRef<'st>(_, _);
Expand description
Methods from Deref<Target = Stanza>§
sourcepub fn to_text(&self) -> Result<String, ToTextError>
pub fn to_text(&self) -> Result<String, ToTextError>
sourcepub fn attribute_count(&self) -> i32
pub fn attribute_count(&self) -> i32
sourcepub fn attributes(&self) -> HashMap<&str, &str>
pub fn attributes(&self) -> HashMap<&str, &str>
This method returns data as HashMap
unlike underlying function.
sourcepub fn stanza_type(&self) -> Option<&str>
pub fn stanza_type(&self) -> Option<&str>
sourcepub fn get_first_child(&self) -> Option<StanzaRef<'_>>
pub fn get_first_child(&self) -> Option<StanzaRef<'_>>
sourcepub fn get_child_by_name_and_ns(
&self,
name: impl AsRef<str>,
ns: impl AsRef<str>
) -> Option<StanzaRef<'_>>
pub fn get_child_by_name_and_ns( &self, name: impl AsRef<str>, ns: impl AsRef<str> ) -> Option<StanzaRef<'_>>
sourcepub fn get_child_by_path(&self, path: &[&str]) -> Option<StanzaRef<'_>>
pub fn get_child_by_path(&self, path: &[&str]) -> Option<StanzaRef<'_>>
Due to internal limitations (vararg call in C) this function supports a maximum of 10 elements
in the path
slice.
pub fn children(&self) -> impl Iterator<Item = StanzaRef<'_>>
sourcepub fn reply_error(
&self,
error_type: impl AsRef<str>,
condition: impl AsRef<str>,
text: impl AsRef<str>
) -> Self
pub fn reply_error( &self, error_type: impl AsRef<str>, condition: impl AsRef<str>, text: impl AsRef<str> ) -> Self
Trait Implementations§
source§impl PartialEq<StanzaRef<'_>> for StanzaRef<'_>
impl PartialEq<StanzaRef<'_>> for StanzaRef<'_>
impl<'st> Eq for StanzaRef<'st>
impl<'st> StructuralEq for StanzaRef<'st>
Auto Trait Implementations§
impl<'st> RefUnwindSafe for StanzaRef<'st>
impl<'st> !Send for StanzaRef<'st>
impl<'st> !Sync for StanzaRef<'st>
impl<'st> Unpin for StanzaRef<'st>
impl<'st> UnwindSafe for StanzaRef<'st>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more