[−][src]Struct xmpp_parsers::FullJid
A struct representing a full Jabber ID.
A full Jabber ID is composed of 3 components, of which one is optional:
- A node/name,
node
, which is the optional part before the @. - A domain,
domain
, which is the mandatory part after the @ but before the /. - A resource,
resource
, which is the part after the /.
Unlike a BareJid
, it always contains a resource, and should only be used when you are certain
there is no case where a resource can be missing. Otherwise, use a Jid
enum.
Fields
node: Option<String>
The node part of the Jabber ID, if it exists, else None.
domain: String
The domain of the Jabber ID.
resource: String
The resource of the Jabber ID.
Implementations
impl FullJid
[src]
pub fn new<NS, DS, RS>(node: NS, domain: DS, resource: RS) -> FullJid where
DS: Into<String>,
NS: Into<String>,
RS: Into<String>,
[src]
DS: Into<String>,
NS: Into<String>,
RS: Into<String>,
Constructs a full Jabber ID containing all three components.
This is of the form node
@domain
/resource
.
Examples
use jid::FullJid; let jid = FullJid::new("node", "domain", "resource"); assert_eq!(jid.node, Some("node".to_owned())); assert_eq!(jid.domain, "domain".to_owned()); assert_eq!(jid.resource, "resource".to_owned());
pub fn with_node<NS>(&self, node: NS) -> FullJid where
NS: Into<String>,
[src]
NS: Into<String>,
Constructs a new Jabber ID from an existing one, with the node swapped out with a new one.
Examples
use jid::FullJid; let jid = FullJid::new("node", "domain", "resource"); assert_eq!(jid.node, Some("node".to_owned())); let new_jid = jid.with_node("new_node"); assert_eq!(new_jid.node, Some("new_node".to_owned()));
pub fn with_domain<DS>(&self, domain: DS) -> FullJid where
DS: Into<String>,
[src]
DS: Into<String>,
Constructs a new Jabber ID from an existing one, with the domain swapped out with a new one.
Examples
use jid::FullJid; let jid = FullJid::new("node", "domain", "resource"); assert_eq!(jid.domain, "domain".to_owned()); let new_jid = jid.with_domain("new_domain"); assert_eq!(new_jid.domain, "new_domain");
pub fn with_resource<RS>(&self, resource: RS) -> FullJid where
RS: Into<String>,
[src]
RS: Into<String>,
Constructs a full Jabber ID from a bare Jabber ID, specifying a resource
.
Examples
use jid::FullJid; let jid = FullJid::new("node", "domain", "resource"); assert_eq!(jid.resource, "resource".to_owned()); let new_jid = jid.with_resource("new_resource"); assert_eq!(new_jid.resource, "new_resource");
Trait Implementations
impl Clone for FullJid
[src]
impl Debug for FullJid
[src]
impl Display for FullJid
[src]
impl Eq for FullJid
[src]
impl From<BindResponse> for FullJid
[src]
pub fn from(bind: BindResponse) -> FullJid
[src]
impl From<FullJid> for Jid
[src]
impl FromStr for FullJid
[src]
type Err = JidParseError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<FullJid, JidParseError>
[src]
impl Hash for FullJid
[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<BareJid> for FullJid
[src]
impl Into<Node> for FullJid
[src]
impl IntoAttributeValue for FullJid
[src]
pub fn into_attribute_value(self) -> Option<String>
[src]
impl PartialEq<FullJid> for FullJid
[src]
impl PartialEq<FullJid> for Jid
[src]
pub fn eq(&self, other: &FullJid) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Jid> for FullJid
[src]
pub fn eq(&self, other: &Jid) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for FullJid
[src]
impl StructuralPartialEq for FullJid
[src]
impl TryFrom<Jid> for FullJid
[src]
Auto Trait Implementations
impl RefUnwindSafe for FullJid
[src]
impl Send for FullJid
[src]
impl Sync for FullJid
[src]
impl Unpin for FullJid
[src]
impl UnwindSafe for FullJid
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,