Struct tokio_xmpp::Element

source ·
pub struct Element {
    pub prefixes: Prefixes,
    /* private fields */
}
Expand description

A struct representing a DOM Element.

Fields§

§prefixes: Prefixes

Namespace declarations

Implementations§

source§

impl Element

source

pub fn builder<S, NS>(name: S, namespace: NS) -> ElementBuilderwhere S: AsRef<str>, NS: Into<String>,

Return a builder for an Element with the given name.

Examples
use minidom::Element;

let elem = Element::builder("name", "namespace")
                   .attr("name", "value")
                   .append("inner")
                   .build();

assert_eq!(elem.name(), "name");
assert_eq!(elem.ns(), "namespace".to_owned());
assert_eq!(elem.attr("name"), Some("value"));
assert_eq!(elem.attr("inexistent"), None);
assert_eq!(elem.text(), "inner");
source

pub fn bare<S, NS>(name: S, namespace: NS) -> Elementwhere S: Into<String>, NS: Into<String>,

Returns a bare minimum Element with this name.

Examples
use minidom::Element;

let bare = Element::bare("name", "namespace");

assert_eq!(bare.name(), "name");
assert_eq!(bare.ns(), "namespace");
assert_eq!(bare.attr("name"), None);
assert_eq!(bare.text(), "");
source

pub fn name(&self) -> &str

Returns a reference to the local name of this element (that is, without a possible prefix).

source

pub fn ns(&self) -> String

Returns a reference to the namespace of this element.

source

pub fn attr(&self, name: &str) -> Option<&str>

Returns a reference to the value of the given attribute, if it exists, else None.

source

pub fn attrs(&self) -> Attrs<'_>

Returns an iterator over the attributes of this element.

Example
use minidom::Element;

let elm: Element = "<elem xmlns=\"ns1\" a=\"b\" />".parse().unwrap();

let mut iter = elm.attrs();

assert_eq!(iter.next().unwrap(), ("a", "b"));
assert_eq!(iter.next(), None);
source

pub fn attrs_mut(&mut self) -> AttrsMut<'_>

Returns an iterator over the attributes of this element, with the value being a mutable reference.

source

pub fn set_attr<S, V>(&mut self, name: S, val: V)where S: Into<String>, V: IntoAttributeValue,

Modifies the value of an attribute.

source

pub fn is<'a, N, NS>(&self, name: N, namespace: NS) -> boolwhere N: AsRef<str>, NS: Into<NSChoice<'a>>,

Returns whether the element has the given name and namespace.

Examples
use minidom::{Element, NSChoice};

let elem = Element::builder("name", "namespace").build();

assert_eq!(elem.is("name", "namespace"), true);
assert_eq!(elem.is("name", "wrong"), false);
assert_eq!(elem.is("wrong", "namespace"), false);
assert_eq!(elem.is("wrong", "wrong"), false);

assert_eq!(elem.is("name", NSChoice::OneOf("namespace")), true);
assert_eq!(elem.is("name", NSChoice::OneOf("foo")), false);
assert_eq!(elem.is("name", NSChoice::AnyOf(&["foo", "namespace"])), true);
assert_eq!(elem.is("name", NSChoice::Any), true);
source

pub fn has_ns<'a, NS>(&self, namespace: NS) -> boolwhere NS: Into<NSChoice<'a>>,

Returns whether the element has the given namespace.

Examples
use minidom::{Element, NSChoice};

let elem = Element::builder("name", "namespace").build();

assert_eq!(elem.has_ns("namespace"), true);
assert_eq!(elem.has_ns("wrong"), false);

assert_eq!(elem.has_ns(NSChoice::OneOf("namespace")), true);
assert_eq!(elem.has_ns(NSChoice::OneOf("foo")), false);
assert_eq!(elem.has_ns(NSChoice::AnyOf(&["foo", "namespace"])), true);
assert_eq!(elem.has_ns(NSChoice::Any), true);
source

pub fn from_reader<R>(reader: R) -> Result<Element, Error>where R: BufRead,

Parse a document from a BufRead.

source

pub fn from_reader_with_prefixes<R, P>( reader: R, prefixes: P ) -> Result<Element, Error>where R: BufRead, P: Into<Prefixes>,

Parse a document from a BufRead, allowing Prefixes to be specified. Useful to provide knowledge of namespaces that would have been declared on parent elements not present in the reader.

source

pub fn write_to<W>(&self, writer: &mut W) -> Result<(), Error>where W: Write,

Output a document to a Writer.

source

pub fn write_to_decl<W>(&self, writer: &mut W) -> Result<(), Error>where W: Write,

Output a document to a Writer.

source

pub fn to_writer<W>( &self, writer: &mut CustomItemWriter<W, SimpleNamespaces> ) -> Result<(), Error>where W: Write,

Output the document to an ItemWriter

source

pub fn to_writer_decl<W>( &self, writer: &mut CustomItemWriter<W, SimpleNamespaces> ) -> Result<(), Error>where W: Write,

Output the document to an ItemWriter

source

pub fn write_to_inner<W>( &self, writer: &mut CustomItemWriter<W, SimpleNamespaces> ) -> Result<(), Error>where W: Write,

Like write_to() but without the <?xml?> prelude

source

pub fn nodes(&self) -> Iter<'_, Node>

Returns an iterator over references to every child node of this element.

Examples
use minidom::Element;

let elem: Element = "<root xmlns=\"ns1\">a<c1 />b<c2 />c</root>".parse().unwrap();

let mut iter = elem.nodes();

assert_eq!(iter.next().unwrap().as_text().unwrap(), "a");
assert_eq!(iter.next().unwrap().as_element().unwrap().name(), "c1");
assert_eq!(iter.next().unwrap().as_text().unwrap(), "b");
assert_eq!(iter.next().unwrap().as_element().unwrap().name(), "c2");
assert_eq!(iter.next().unwrap().as_text().unwrap(), "c");
assert_eq!(iter.next(), None);
source

pub fn nodes_mut(&mut self) -> IterMut<'_, Node>

Returns an iterator over mutable references to every child node of this element.

source

pub fn children(&self) -> Children<'_>

Returns an iterator over references to every child element of this element.

Examples
use minidom::Element;

let elem: Element = "<root xmlns=\"ns1\">hello<child1 xmlns=\"ns1\"/>this<child2 xmlns=\"ns1\"/>is<child3 xmlns=\"ns1\"/>ignored</root>".parse().unwrap();

let mut iter = elem.children();
assert_eq!(iter.next().unwrap().name(), "child1");
assert_eq!(iter.next().unwrap().name(), "child2");
assert_eq!(iter.next().unwrap().name(), "child3");
assert_eq!(iter.next(), None);
source

pub fn children_mut(&mut self) -> ChildrenMut<'_>

Returns an iterator over mutable references to every child element of this element.

source

pub fn texts(&self) -> Texts<'_>

Returns an iterator over references to every text node of this element.

Examples
use minidom::Element;

let elem: Element = "<root xmlns=\"ns1\">hello<c /> world!</root>".parse().unwrap();

let mut iter = elem.texts();
assert_eq!(iter.next().unwrap(), "hello");
assert_eq!(iter.next().unwrap(), " world!");
assert_eq!(iter.next(), None);
source

pub fn texts_mut(&mut self) -> TextsMut<'_>

Returns an iterator over mutable references to every text node of this element.

source

pub fn append_child(&mut self, child: Element) -> &mut Element

Appends a child node to the Element, returning the appended node.

Examples
use minidom::Element;

let mut elem = Element::bare("root", "ns1");

assert_eq!(elem.children().count(), 0);

elem.append_child(Element::bare("child", "ns1"));

{
    let mut iter = elem.children();
    assert_eq!(iter.next().unwrap().name(), "child");
    assert_eq!(iter.next(), None);
}

let child = elem.append_child(Element::bare("new", "ns1"));

assert_eq!(child.name(), "new");
source

pub fn append_text_node<S>(&mut self, child: S)where S: Into<String>,

Appends a text node to an Element.

Examples
use minidom::Element;

let mut elem = Element::bare("node", "ns1");

assert_eq!(elem.text(), "");

elem.append_text_node("text");

assert_eq!(elem.text(), "text");
source

pub fn append_node(&mut self, node: Node)

Appends a node to an Element.

Examples
use minidom::{Element, Node};

let mut elem = Element::bare("node", "ns1");

elem.append_node(Node::Text("hello".to_owned()));

assert_eq!(elem.text(), "hello");
source

pub fn text(&self) -> String

Returns the concatenation of all text nodes in the Element.

Examples
use minidom::Element;

let elem: Element = "<node xmlns=\"ns1\">hello,<split /> world!</node>".parse().unwrap();

assert_eq!(elem.text(), "hello, world!");
source

pub fn get_child<'a, N, NS>(&self, name: N, namespace: NS) -> Option<&Element>where N: AsRef<str>, NS: Into<NSChoice<'a>>,

Returns a reference to the first child element with the specific name and namespace, if it exists in the direct descendants of this Element, else returns None.

Examples
use minidom::{Element, NSChoice};

let elem: Element = r#"<node xmlns="ns"><a/><a xmlns="other_ns" /><b/></node>"#.parse().unwrap();
assert!(elem.get_child("a", "ns").unwrap().is("a", "ns"));
assert!(elem.get_child("a", "other_ns").unwrap().is("a", "other_ns"));
assert!(elem.get_child("b", "ns").unwrap().is("b", "ns"));
assert_eq!(elem.get_child("c", "ns"), None);
assert_eq!(elem.get_child("b", "other_ns"), None);
assert_eq!(elem.get_child("a", "inexistent_ns"), None);
source

pub fn get_child_mut<'a, N, NS>( &mut self, name: N, namespace: NS ) -> Option<&mut Element>where N: AsRef<str>, NS: Into<NSChoice<'a>>,

Returns a mutable reference to the first child element with the specific name and namespace, if it exists in the direct descendants of this Element, else returns None.

source

pub fn has_child<'a, N, NS>(&self, name: N, namespace: NS) -> boolwhere N: AsRef<str>, NS: Into<NSChoice<'a>>,

Returns whether a specific child with this name and namespace exists in the direct descendants of the Element.

Examples
use minidom::{Element, NSChoice};

let elem: Element = r#"<node xmlns="ns"><a /><a xmlns="other_ns" /><b /></node>"#.parse().unwrap();
assert_eq!(elem.has_child("a", "other_ns"), true);
assert_eq!(elem.has_child("a", "ns"), true);
assert_eq!(elem.has_child("a", "inexistent_ns"), false);
assert_eq!(elem.has_child("b", "ns"), true);
assert_eq!(elem.has_child("b", "other_ns"), false);
assert_eq!(elem.has_child("b", "inexistent_ns"), false);
source

pub fn remove_child<'a, N, NS>( &mut self, name: N, namespace: NS ) -> Option<Element>where N: AsRef<str>, NS: Into<NSChoice<'a>>,

Removes the first child with this name and namespace, if it exists, and returns an Option<Element> containing this child if it succeeds. Returns None if no child matches this name and namespace.

Examples
use minidom::{Element, NSChoice};

let mut elem: Element = r#"<node xmlns="ns"><a /><a xmlns="other_ns" /><b /></node>"#.parse().unwrap();
assert!(elem.remove_child("a", "ns").unwrap().is("a", "ns"));
assert!(elem.remove_child("a", "ns").is_none());
assert!(elem.remove_child("inexistent", "inexistent").is_none());
source

pub fn unshift_child(&mut self) -> Option<Element>

Remove the leading nodes up to the first child element and return it

Trait Implementations§

source§

impl Clone for Element

source§

fn clone(&self) -> Element

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Element

source§

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

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

impl From<A> for Element

source§

fn from(elem: A) -> Element

Converts to this type from the input type.
source§

impl From<Abort> for Element

source§

fn from(_: Abort) -> Element

Converts to this type from the input type.
source§

impl From<Action> for Element

source§

fn from(action: Action) -> Element

Converts to this type from the input type.
source§

impl From<Active> for Element

source§

fn from(_: Active) -> Element

Converts to this type from the input type.
source§

impl From<Actor> for Element

source§

fn from(actor: Actor) -> Element

Converts to this type from the input type.
source§

impl From<Affiliation> for Element

source§

fn from(elem: Affiliation) -> Element

Converts to this type from the input type.
source§

impl From<Affiliation> for Element

source§

fn from(elem: Affiliation) -> Element

Converts to this type from the input type.
source§

impl From<Affiliations> for Element

source§

fn from(elem: Affiliations) -> Element

Converts to this type from the input type.
source§

impl From<Affiliations> for Element

source§

fn from(elem: Affiliations) -> Element

Converts to this type from the input type.
source§

impl From<Append> for Element

source§

fn from(elem: Append) -> Element

Converts to this type from the input type.
source§

impl From<Artist> for Element

source§

fn from(elem: Artist) -> Element

Converts to this type from the input type.
source§

impl From<Attention> for Element

source§

fn from(_: Attention) -> Element

Converts to this type from the input type.
source§

impl From<Auth> for Element

source§

fn from(elem: Auth) -> Element

Converts to this type from the input type.
source§

impl From<BindQuery> for Element

source§

fn from(bind: BindQuery) -> Element

Converts to this type from the input type.
source§

impl From<BindResponse> for Element

source§

fn from(bind: BindResponse) -> Element

Converts to this type from the input type.
source§

impl From<Block> for Element

source§

fn from(elem: Block) -> Element

Converts to this type from the input type.
source§

impl From<Blocked> for Element

source§

fn from(_: Blocked) -> Element

Converts to this type from the input type.
source§

impl From<BlocklistRequest> for Element

source§

fn from(_: BlocklistRequest) -> Element

Converts to this type from the input type.
source§

impl From<BlocklistResult> for Element

source§

fn from(elem: BlocklistResult) -> Element

Converts to this type from the input type.
source§

impl From<Body> for Element

source§

fn from(elem: Body) -> Element

Converts to this type from the input type.
source§

impl From<Body> for Element

source§

fn from(body: Body) -> Element

Converts to this type from the input type.
source§

impl From<Bundle> for Element

source§

fn from(elem: Bundle) -> Element

Converts to this type from the input type.
source§

impl From<Candidate> for Element

source§

fn from(elem: Candidate) -> Element

Converts to this type from the input type.
source§

impl From<Candidate> for Element

source§

fn from(elem: Candidate) -> Element

Converts to this type from the input type.
source§

impl From<Candidate> for Element

source§

fn from(elem: Candidate) -> Element

Converts to this type from the input type.
source§

impl From<Caps> for Element

source§

fn from(caps: Caps) -> Element

Converts to this type from the input type.
source§

impl From<Cert> for Element

source§

fn from(elem: Cert) -> Element

Converts to this type from the input type.
source§

impl From<Challenge> for Element

source§

fn from(elem: Challenge) -> Element

Converts to this type from the input type.
source§

impl From<ChatState> for Element

source§

fn from(elem: ChatState) -> Element

Converts to this type from the input type.
source§

impl From<Checksum> for Element

source§

fn from(checksum: Checksum) -> Element

Converts to this type from the input type.
source§

impl From<Close> for Element

source§

fn from(elem: Close) -> Element

Converts to this type from the input type.
source§

impl From<Conference> for Element

source§

fn from(elem: Conference) -> Element

Converts to this type from the input type.
source§

impl From<Conference> for Element

source§

fn from(conference: Conference) -> Element

Converts to this type from the input type.
source§

impl From<Configure> for Element

source§

fn from(elem: Configure) -> Element

Converts to this type from the input type.
source§

impl From<Configure> for Element

source§

fn from(elem: Configure) -> Element

Converts to this type from the input type.
source§

impl From<Content> for Element

source§

fn from(elem: Content) -> Element

Converts to this type from the input type.
source§

impl From<Content> for Element

source§

fn from(elem: Content) -> Element

Converts to this type from the input type.
source§

impl From<Continue> for Element

source§

fn from(elem: Continue) -> Element

Converts to this type from the input type.
source§

impl From<Create> for Element

source§

fn from(elem: Create) -> Element

Converts to this type from the input type.
source§

impl From<Create> for Element

source§

fn from(elem: Create) -> Element

Converts to this type from the input type.
source§

impl From<Credentials> for Element

source§

fn from(elem: Credentials) -> Element

Converts to this type from the input type.
source§

impl From<Data> for Element

source§

fn from(elem: Data) -> Element

Converts to this type from the input type.
source§

impl From<Data> for Element

source§

fn from(elem: Data) -> Element

Converts to this type from the input type.
source§

impl From<Data> for Element

source§

fn from(elem: Data) -> Element

Converts to this type from the input type.
source§

impl From<DataForm> for Element

source§

fn from(form: DataForm) -> Element

Converts to this type from the input type.
source§

impl From<Default> for Element

source§

fn from(elem: Default) -> Element

Converts to this type from the input type.
source§

impl From<Default> for Element

source§

fn from(elem: Default) -> Element

Converts to this type from the input type.
source§

impl From<DefinedCondition> for Element

source§

fn from(elem: DefinedCondition) -> Element

Converts to this type from the input type.
source§

impl From<DefinedCondition> for Element

source§

fn from(elem: DefinedCondition) -> Element

Converts to this type from the input type.
source§

impl From<Delay> for Element

source§

fn from(elem: Delay) -> Element

Converts to this type from the input type.
source§

impl From<Delete> for Element

source§

fn from(elem: Delete) -> Element

Converts to this type from the input type.
source§

impl From<Description> for Element

source§

fn from(elem: Description) -> Element

Converts to this type from the input type.
source§

impl From<Description> for Element

source§

fn from(desc: Description) -> Element

Converts to this type from the input type.
source§

impl From<Description> for Element

source§

fn from(description: Description) -> Element

Converts to this type from the input type.
source§

impl From<Destroy> for Element

source§

fn from(elem: Destroy) -> Element

Converts to this type from the input type.
source§

impl From<Device> for Element

source§

fn from(elem: Device) -> Element

Converts to this type from the input type.
source§

impl From<DeviceList> for Element

source§

fn from(elem: DeviceList) -> Element

Converts to this type from the input type.
source§

impl From<Disable> for Element

source§

fn from(_: Disable) -> Element

Converts to this type from the input type.
source§

impl From<Disable> for Element

source§

fn from(elem: Disable) -> Element

Converts to this type from the input type.
source§

impl From<DiscoInfoQuery> for Element

source§

fn from(elem: DiscoInfoQuery) -> Element

Converts to this type from the input type.
source§

impl From<DiscoInfoResult> for Element

source§

fn from(disco: DiscoInfoResult) -> Element

Converts to this type from the input type.
source§

impl From<DiscoItemsQuery> for Element

source§

fn from(elem: DiscoItemsQuery) -> Element

Converts to this type from the input type.
source§

impl From<DiscoItemsResult> for Element

source§

fn from(elem: DiscoItemsResult) -> Element

Converts to this type from the input type.
source§

impl From<ECaps2> for Element

source§

fn from(elem: ECaps2) -> Element

Converts to this type from the input type.
source§

impl From<Enable> for Element

source§

fn from(elem: Enable) -> Element

Converts to this type from the input type.
source§

impl From<Enable> for Element

source§

fn from(_: Enable) -> Element

Converts to this type from the input type.
source§

impl From<Enabled> for Element

source§

fn from(elem: Enabled) -> Element

Converts to this type from the input type.
source§

impl From<Encrypted> for Element

source§

fn from(elem: Encrypted) -> Element

Converts to this type from the input type.
source§

impl From<Erase> for Element

source§

fn from(elem: Erase) -> Element

Converts to this type from the input type.
source§

impl From<ExplicitMessageEncryption> for Element

source§

fn from(elem: ExplicitMessageEncryption) -> Element

Converts to this type from the input type.
source§

impl From<Failed> for Element

source§

fn from(elem: Failed) -> Element

Converts to this type from the input type.
source§

impl From<Failure> for Element

source§

fn from(failure: Failure) -> Element

Converts to this type from the input type.
source§

impl From<Feature> for Element

source§

fn from(_: Feature) -> Element

Converts to this type from the input type.
source§

impl From<Feature> for Element

source§

fn from(elem: Feature) -> Element

Converts to this type from the input type.
source§

impl From<Field> for Element

source§

fn from(field: Field) -> Element

Converts to this type from the input type.
source§

impl From<File> for Element

source§

fn from(file: File) -> Element

Converts to this type from the input type.
source§

impl From<Fin> for Element

source§

fn from(elem: Fin) -> Element

Converts to this type from the input type.
source§

impl From<Fingerprint> for Element

source§

fn from(elem: Fingerprint) -> Element

Converts to this type from the input type.
source§

impl From<Forwarded> for Element

source§

fn from(elem: Forwarded) -> Element

Converts to this type from the input type.
source§

impl From<Get> for Element

source§

fn from(elem: Get) -> Element

Converts to this type from the input type.
source§

impl From<Group> for Element

source§

fn from(elem: Group) -> Element

Converts to this type from the input type.
source§

impl From<Group> for Element

source§

fn from(elem: Group) -> Element

Converts to this type from the input type.
source§

impl From<Group> for Element

source§

fn from(elem: Group) -> Element

Converts to this type from the input type.
source§

impl From<Handshake> for Element

source§

fn from(elem: Handshake) -> Element

Converts to this type from the input type.
source§

impl From<Hash> for Element

source§

fn from(elem: Hash) -> Element

Converts to this type from the input type.
source§

impl From<Header> for Element

source§

fn from(elem: Header) -> Element

Converts to this type from the input type.
source§

impl From<Header> for Element

source§

fn from(elem: Header) -> Element

Converts to this type from the input type.
source§

impl From<History> for Element

source§

fn from(elem: History) -> Element

Converts to this type from the input type.
source§

impl From<IV> for Element

source§

fn from(elem: IV) -> Element

Converts to this type from the input type.
source§

impl From<Identity> for Element

source§

fn from(elem: Identity) -> Element

Converts to this type from the input type.
source§

impl From<IdentityKey> for Element

source§

fn from(elem: IdentityKey) -> Element

Converts to this type from the input type.
source§

impl From<Idle> for Element

source§

fn from(elem: Idle) -> Element

Converts to this type from the input type.
source§

impl From<Inactive> for Element

source§

fn from(_: Inactive) -> Element

Converts to this type from the input type.
source§

impl From<Info> for Element

source§

fn from(elem: Info) -> Element

Converts to this type from the input type.
source§

impl From<Insert> for Element

source§

fn from(elem: Insert) -> Element

Converts to this type from the input type.
source§

impl From<Iq> for Element

source§

fn from(iq: Iq) -> Element

Converts to this type from the input type.
source§

impl From<Item> for Element

source§

fn from(item: Item) -> Element

Converts to this type from the input type.
source§

impl From<Item> for Element

source§

fn from(elem: Item) -> Element

Converts to this type from the input type.
source§

impl From<Item> for Element

source§

fn from(item: Item) -> Element

Converts to this type from the input type.
source§

impl From<Item> for Element

source§

fn from(elem: Item) -> Element

Converts to this type from the input type.
source§

impl From<Item> for Element

source§

fn from(elem: Item) -> Element

Converts to this type from the input type.
source§

impl From<Item> for Element

source§

fn from(elem: Item) -> Element

Converts to this type from the input type.
source§

impl From<Items> for Element

source§

fn from(elem: Items) -> Element

Converts to this type from the input type.
source§

impl From<JidPrepQuery> for Element

source§

fn from(elem: JidPrepQuery) -> Element

Converts to this type from the input type.
source§

impl From<JidPrepResponse> for Element

source§

fn from(elem: JidPrepResponse) -> Element

Converts to this type from the input type.
source§

impl From<Jingle> for Element

source§

fn from(jingle: Jingle) -> Element

Converts to this type from the input type.
source§

impl From<JingleMI> for Element

source§

fn from(jingle_mi: JingleMI) -> Element

Converts to this type from the input type.
source§

impl From<Join> for Element

source§

fn from(elem: Join) -> Element

Converts to this type from the input type.
source§

impl From<Key> for Element

source§

fn from(elem: Key) -> Element

Converts to this type from the input type.
source§

impl From<Leave> for Element

source§

fn from(_: Leave) -> Element

Converts to this type from the input type.
source§

impl From<Length> for Element

source§

fn from(elem: Length) -> Element

Converts to this type from the input type.
source§

impl From<ListCertsQuery> for Element

source§

fn from(_: ListCertsQuery) -> Element

Converts to this type from the input type.
source§

impl From<ListCertsResponse> for Element

source§

fn from(elem: ListCertsResponse) -> Element

Converts to this type from the input type.
source§

impl From<MediaElement> for Element

source§

fn from(elem: MediaElement) -> Element

Converts to this type from the input type.
source§

impl From<Message> for Element

source§

fn from(message: Message) -> Element

Converts to this type from the input type.
source§

impl From<Metadata> for Element

source§

fn from(elem: Metadata) -> Element

Converts to this type from the input type.
source§

impl From<Mix> for Element

source§

fn from(elem: Mix) -> Element

Converts to this type from the input type.
source§

impl From<MoodEnum> for Element

source§

fn from(elem: MoodEnum) -> Element

Converts to this type from the input type.
source§

impl From<Muc> for Element

source§

fn from(elem: Muc) -> Element

Converts to this type from the input type.
source§

impl From<MucUser> for Element

source§

fn from(elem: MucUser) -> Element

Converts to this type from the input type.
source§

impl From<Name> for Element

source§

fn from(elem: Name) -> Element

Converts to this type from the input type.
source§

impl From<Nick> for Element

source§

fn from(elem: Nick) -> Element

Converts to this type from the input type.
source§

impl From<OccupantId> for Element

source§

fn from(elem: OccupantId) -> Element

Converts to this type from the input type.
source§

impl From<Open> for Element

source§

fn from(elem: Open) -> Element

Converts to this type from the input type.
source§

impl From<Open> for Element

source§

fn from(elem: Open) -> Element

Converts to this type from the input type.
source§

impl From<Option_> for Element

source§

fn from(elem: Option_) -> Element

Converts to this type from the input type.
source§

impl From<Options> for Element

source§

fn from(elem: Options) -> Element

Converts to this type from the input type.
source§

impl From<OriginId> for Element

source§

fn from(elem: OriginId) -> Element

Converts to this type from the input type.
source§

impl From<Parameter> for Element

source§

fn from(elem: Parameter) -> Element

Converts to this type from the input type.
source§

impl From<Parameter> for Element

source§

fn from(elem: Parameter) -> Element

Converts to this type from the input type.
source§

impl From<Participant> for Element

source§

fn from(elem: Participant) -> Element

Converts to this type from the input type.
source§

impl From<Payload> for Element

source§

fn from(elem: Payload) -> Element

Converts to this type from the input type.
source§

impl From<PayloadType> for Element

source§

fn from(elem: PayloadType) -> Element

Converts to this type from the input type.
source§

impl From<Ping> for Element

source§

fn from(_: Ping) -> Element

Converts to this type from the input type.
source§

impl From<PreKeyPublic> for Element

source§

fn from(elem: PreKeyPublic) -> Element

Converts to this type from the input type.
source§

impl From<Prefs> for Element

source§

fn from(prefs: Prefs) -> Element

Converts to this type from the input type.
source§

impl From<Prekeys> for Element

source§

fn from(elem: Prekeys) -> Element

Converts to this type from the input type.
source§

impl From<Presence> for Element

source§

fn from(presence: Presence) -> Element

Converts to this type from the input type.
source§

impl From<Private> for Element

source§

fn from(_: Private) -> Element

Converts to this type from the input type.
source§

impl From<PubKey> for Element

source§

fn from(elem: PubKey) -> Element

Converts to this type from the input type.
source§

impl From<PubKeyData> for Element

source§

fn from(elem: PubKeyData) -> Element

Converts to this type from the input type.
source§

impl From<PubKeyMeta> for Element

source§

fn from(elem: PubKeyMeta) -> Element

Converts to this type from the input type.
source§

impl From<PubKeysMeta> for Element

source§

fn from(elem: PubKeysMeta) -> Element

Converts to this type from the input type.
source§

impl From<PubSub> for Element

source§

fn from(pubsub: PubSub) -> Element

Converts to this type from the input type.
source§

impl From<PubSubEvent> for Element

source§

fn from(event: PubSubEvent) -> Element

Converts to this type from the input type.
source§

impl From<PubSubOwner> for Element

source§

fn from(pubsub: PubSubOwner) -> Element

Converts to this type from the input type.
source§

impl From<Publish> for Element

source§

fn from(elem: Publish) -> Element

Converts to this type from the input type.
source§

impl From<PublishOptions> for Element

source§

fn from(elem: PublishOptions) -> Element

Converts to this type from the input type.
source§

impl From<Purge> for Element

source§

fn from(elem: Purge) -> Element

Converts to this type from the input type.
source§

impl From<Put> for Element

source§

fn from(elem: Put) -> Element

Converts to this type from the input type.
source§

impl From<Query> for Element

source§

fn from(query: Query) -> Element

Converts to this type from the input type.
source§

impl From<Query> for Element

source§

fn from(elem: Query) -> Element

Converts to this type from the input type.
source§

impl From<R> for Element

source§

fn from(_: R) -> Element

Converts to this type from the input type.
source§

impl From<Range> for Element

source§

fn from(elem: Range) -> Element

Converts to this type from the input type.
source§

impl From<Rating> for Element

source§

fn from(elem: Rating) -> Element

Converts to this type from the input type.
source§

impl From<Reaction> for Element

source§

fn from(elem: Reaction) -> Element

Converts to this type from the input type.
source§

impl From<Reactions> for Element

source§

fn from(elem: Reactions) -> Element

Converts to this type from the input type.
source§

impl From<Reason> for Element

source§

fn from(elem: Reason) -> Element

Converts to this type from the input type.
source§

impl From<Reason> for Element

source§

fn from(reason: Reason) -> Element

Converts to this type from the input type.
source§

impl From<ReasonElement> for Element

source§

fn from(reason: ReasonElement) -> Element

Converts to this type from the input type.
source§

impl From<Received> for Element

source§

fn from(elem: Received) -> Element

Converts to this type from the input type.
source§

impl From<Received> for Element

source§

fn from(elem: Received) -> Element

Converts to this type from the input type.
source§

impl From<Received> for Element

source§

fn from(elem: Received) -> Element

Converts to this type from the input type.
source§

impl From<Redirect> for Element

source§

fn from(elem: Redirect) -> Element

Converts to this type from the input type.
source§

impl From<Replace> for Element

source§

fn from(elem: Replace) -> Element

Converts to this type from the input type.
source§

impl From<Request> for Element

source§

fn from(_: Request) -> Element

Converts to this type from the input type.
source§

impl From<Resource> for Element

source§

fn from(elem: Resource) -> Element

Converts to this type from the input type.
source§

impl From<Response> for Element

source§

fn from(elem: Response) -> Element

Converts to this type from the input type.
source§

impl From<Result_> for Element

source§

fn from(elem: Result_) -> Element

Converts to this type from the input type.
source§

impl From<Resume> for Element

source§

fn from(elem: Resume) -> Element

Converts to this type from the input type.
source§

impl From<Resumed> for Element

source§

fn from(elem: Resumed) -> Element

Converts to this type from the input type.
source§

impl From<Retract> for Element

source§

fn from(elem: Retract) -> Element

Converts to this type from the input type.
source§

impl From<Revoke> for Element

source§

fn from(elem: Revoke) -> Element

Converts to this type from the input type.
source§

impl From<Roster> for Element

source§

fn from(elem: Roster) -> Element

Converts to this type from the input type.
source§

impl From<RtcpFb> for Element

source§

fn from(elem: RtcpFb) -> Element

Converts to this type from the input type.
source§

impl From<RtcpMux> for Element

source§

fn from(_: RtcpMux) -> Element

Converts to this type from the input type.
source§

impl From<RtpHdrext> for Element

source§

fn from(elem: RtpHdrext) -> Element

Converts to this type from the input type.
source§

impl From<Rtt> for Element

source§

fn from(elem: Rtt) -> Element

Converts to this type from the input type.
source§

impl From<Sent> for Element

source§

fn from(elem: Sent) -> Element

Converts to this type from the input type.
source§

impl From<Service> for Element

source§

fn from(elem: Service) -> Element

Converts to this type from the input type.
source§

impl From<ServicesQuery> for Element

source§

fn from(elem: ServicesQuery) -> Element

Converts to this type from the input type.
source§

impl From<ServicesResult> for Element

source§

fn from(elem: ServicesResult) -> Element

Converts to this type from the input type.
source§

impl From<SetNick> for Element

source§

fn from(elem: SetNick) -> Element

Converts to this type from the input type.
source§

impl From<SetQuery> for Element

source§

fn from(set: SetQuery) -> Element

Converts to this type from the input type.
source§

impl From<SetResult> for Element

source§

fn from(set: SetResult) -> Element

Converts to this type from the input type.
source§

impl From<Show> for Element

source§

fn from(show: Show) -> Element

Converts to this type from the input type.
source§

impl From<SignedPreKeyPublic> for Element

source§

fn from(elem: SignedPreKeyPublic) -> Element

Converts to this type from the input type.
source§

impl From<SignedPreKeySignature> for Element

source§

fn from(elem: SignedPreKeySignature) -> Element

Converts to this type from the input type.
source§

impl From<SlotRequest> for Element

source§

fn from(elem: SlotRequest) -> Element

Converts to this type from the input type.
source§

impl From<SlotResult> for Element

source§

fn from(elem: SlotResult) -> Element

Converts to this type from the input type.
source§

impl From<Source> for Element

source§

fn from(elem: Source) -> Element

Converts to this type from the input type.
source§

impl From<Source> for Element

source§

fn from(elem: Source) -> Element

Converts to this type from the input type.
source§

impl From<StanzaError> for Element

source§

fn from(err: StanzaError) -> Element

Converts to this type from the input type.
source§

impl From<StanzaId> for Element

source§

fn from(elem: StanzaId) -> Element

Converts to this type from the input type.
source§

impl From<Status> for Element

source§

fn from(elem: Status) -> Element

Converts to this type from the input type.
source§

impl From<Storage> for Element

source§

fn from(elem: Storage) -> Element

Converts to this type from the input type.
source§

impl From<Stream> for Element

source§

fn from(elem: Stream) -> Element

Converts to this type from the input type.
source§

impl From<StreamManagement> for Element

source§

fn from(_: StreamManagement) -> Element

Converts to this type from the input type.
source§

impl From<Subject> for Element

source§

fn from(elem: Subject) -> Element

Converts to this type from the input type.
source§

impl From<Subscribe> for Element

source§

fn from(elem: Subscribe) -> Element

Converts to this type from the input type.
source§

impl From<Subscribe> for Element

source§

fn from(elem: Subscribe) -> Element

Converts to this type from the input type.
source§

impl From<SubscribeOptions> for Element

source§

fn from(subscribe_options: SubscribeOptions) -> Element

Converts to this type from the input type.
source§

impl From<SubscriptionElem> for Element

source§

fn from(elem: SubscriptionElem) -> Element

Converts to this type from the input type.
source§

impl From<SubscriptionElem> for Element

source§

fn from(elem: SubscriptionElem) -> Element

Converts to this type from the input type.
source§

impl From<Subscriptions> for Element

source§

fn from(elem: Subscriptions) -> Element

Converts to this type from the input type.
source§

impl From<Subscriptions> for Element

source§

fn from(elem: Subscriptions) -> Element

Converts to this type from the input type.
source§

impl From<Success> for Element

source§

fn from(elem: Success) -> Element

Converts to this type from the input type.
source§

impl From<Tag> for Element

source§

fn from(tag: Tag) -> Element

Converts to this type from the input type.
source§

impl From<Text> for Element

source§

fn from(elem: Text) -> Element

Converts to this type from the input type.
source§

impl From<Thread> for Element

source§

fn from(elem: Thread) -> Element

Converts to this type from the input type.
source§

impl From<TimeQuery> for Element

source§

fn from(_: TimeQuery) -> Element

Converts to this type from the input type.
source§

impl From<TimeResult> for Element

source§

fn from(time: TimeResult) -> Element

Converts to this type from the input type.
source§

impl From<Title> for Element

source§

fn from(elem: Title) -> Element

Converts to this type from the input type.
source§

impl From<Track> for Element

source§

fn from(elem: Track) -> Element

Converts to this type from the input type.
source§

impl From<Transport> for Element

source§

fn from(transport: Transport) -> Element

Converts to this type from the input type.
source§

impl From<Transport> for Element

source§

fn from(elem: Transport) -> Element

Converts to this type from the input type.
source§

impl From<Transport> for Element

source§

fn from(elem: Transport) -> Element

Converts to this type from the input type.
source§

impl From<Transport> for Element

source§

fn from(elem: Transport) -> Element

Converts to this type from the input type.
source§

impl From<Transport> for Element

source§

fn from(transport: Transport) -> Element

Converts to this type from the input type.
source§

impl From<Tune> for Element

source§

fn from(tune: Tune) -> Element

Converts to this type from the input type.
source§

impl From<URI> for Element

source§

fn from(elem: URI) -> Element

Converts to this type from the input type.
source§

impl From<Unblock> for Element

source§

fn from(elem: Unblock) -> Element

Converts to this type from the input type.
source§

impl From<Unsubscribe> for Element

source§

fn from(elem: Unsubscribe) -> Element

Converts to this type from the input type.
source§

impl From<UpdateSubscription> for Element

source§

fn from(elem: UpdateSubscription) -> Element

Converts to this type from the input type.
source§

impl From<Uri> for Element

source§

fn from(elem: Uri) -> Element

Converts to this type from the input type.
source§

impl From<Url> for Element

source§

fn from(elem: Url) -> Element

Converts to this type from the input type.
source§

impl From<Users> for Element

source§

fn from(elem: Users) -> Element

Converts to this type from the input type.
source§

impl From<VersionQuery> for Element

source§

fn from(_: VersionQuery) -> Element

Converts to this type from the input type.
source§

impl From<VersionResult> for Element

source§

fn from(elem: VersionResult) -> Element

Converts to this type from the input type.
source§

impl From<Wait> for Element

source§

fn from(elem: Wait) -> Element

Converts to this type from the input type.
source§

impl From<XhtmlIm> for Element

source§

fn from(wrapper: XhtmlIm) -> Element

Converts to this type from the input type.
source§

impl FromStr for Element

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Element, Error>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for Element

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Sink<Element> for Component

§

type Error = Error

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

fn start_send(self: Pin<&mut Self>, item: Element) -> 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 TryFrom<Element> for Hash

§

type Error = Error

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

fn try_from(elem: Element) -> Result<Hash, Error>

Performs the conversion.
source§

impl Eq for Element

source§

impl StructuralEq for Element

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more