[−][src]Struct xmpp_parsers::presence::Presence
The main structure representing the <presence/>
stanza.
Fields
from: Option<Jid>
The sender of this presence.
to: Option<Jid>
The recipient of this presence.
id: Option<String>
The identifier, unique on this stream, of this stanza.
type_: Type
The type of this presence stanza.
show: Option<Show>
The availability of the sender of this presence.
statuses: BTreeMap<String, String>
A localised list of statuses defined in this presence.
priority: i8
The sender’s resource priority, if negative it won’t receive messages that haven’t been directed to it.
payloads: Vec<Element>
A list of payloads contained in this presence.
Methods
impl Presence
[src]
pub fn new(type_: Type) -> Presence
[src]
Create a new presence of this type.
pub fn with_from(self, from: Option<Jid>) -> Presence
[src]
Set the emitter of this presence, this should only be useful for servers and components, as clients can only send presences from their own resource (which is implicit).
pub fn with_to(self, to: Option<Jid>) -> Presence
[src]
Set the recipient of this presence, this is only useful for directed presences.
pub fn with_id(self, id: Option<String>) -> Presence
[src]
Set the identifier for this presence.
pub fn with_show(self, show: Show) -> Presence
[src]
Set the availability information of this presence.
pub fn with_priority(self, priority: i8) -> Presence
[src]
Set the priority of this presence.
pub fn with_payloads(self, payloads: Vec<Element>) -> Presence
[src]
Set the payloads of this presence.
pub fn set_status<L, S>(&mut self, lang: L, status: S) where
L: Into<String>,
S: Into<String>,
[src]
L: Into<String>,
S: Into<String>,
Set the availability information of this presence.
pub fn add_payload<P: PresencePayload>(&mut self, payload: P)
[src]
Add a payload to this presence.
Trait Implementations
impl From<Presence> for Element
[src]
impl Clone for Presence
[src]
fn clone(&self) -> Presence
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Presence
[src]
impl TryFrom<Element> for Presence
[src]
Auto Trait Implementations
impl Unpin for Presence
impl !Sync for Presence
impl !Send for Presence
impl !RefUnwindSafe for Presence
impl !UnwindSafe for Presence
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> IntoElements for T where
T: Into<Element>,
[src]
T: Into<Element>,
fn into_elements(self, emitter: &mut ElementEmitter)
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self