Client

Struct Client 

Source
pub struct Client {
    pub connected: bool,
    pub id: String,
    pub type_: Type,
    pub first_seen: Option<DateTime>,
    pub last_seen: Option<DateTime>,
    pub user_agent: UserAgent,
    pub auth: Auth,
    pub permission: Permission,
}
Expand description

Represents a client that is know by the server.

Fields§

§connected: bool

Reflects whether this client has an active session on the server (“active” includes connected and sessions that may be disconnected but may yet be reconnected, e.g. using Stream Management (XEP-0198)).

§id: String

An opaque reference for the client, which can be used to revoke access.

§type_: Type

Either “session” if this client is known to have an active or inactive client session on the server, or “access” if no session has been established (e.g. it may have been granted access to the account, but only used non-XMPP APIs or never logged in).

§first_seen: Option<DateTime>

Contains timestamps that reflect when this client was first granted access to the user’s account.

§last_seen: Option<DateTime>

Contains timestamps that reflect when this client most recently used that access.

§user_agent: UserAgent

Information about the client software.

§auth: Auth

Lists the known authentication methods that the client has used to gain access to the account.

§permission: Permission

Contains details of the client’s level of access to the user’s account.

Trait Implementations§

Source§

impl AsXml for Client

Source§

type ItemIter<'xso_proc_as_xml_iter_lifetime> = ClientAsXmlIterator<'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 Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate 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 Client

Source§

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

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

impl From<&Client> for Element

Source§

fn from(other: &Client) -> Self

Converts to this type from the input type.
Source§

impl From<Client> for Element

Source§

fn from(other: Client) -> Self

Converts to this type from the input type.
Source§

impl FromXml for Client

Source§

type Builder = ClientFromXmlBuilder

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 Client

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 TryFrom<Element> for Client

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 StructuralPartialEq for Client

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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