Struct jid_gst_meet::BareJid [−][src]
Expand description
A struct representing a bare Jabber ID.
A bare Jabber ID is composed of 2 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 @.
Unlike a FullJid
, it can’t contain a resource, and should only be used when you are certain
there is no case where a resource can be set. 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.
Implementations
Constructs a bare Jabber ID, containing two components.
This is of the form node
@domain
.
Examples
use jid::BareJid;
let jid = BareJid::new("node", "domain");
assert_eq!(jid.node, Some("node".to_owned()));
assert_eq!(jid.domain, "domain".to_owned());
Constructs a bare Jabber ID containing only a domain
.
This is of the form domain
.
Examples
use jid::BareJid;
let jid = BareJid::domain("domain");
assert_eq!(jid.node, None);
assert_eq!(jid.domain, "domain".to_owned());
Constructs a new Jabber ID from an existing one, with the node swapped out with a new one.
Examples
use jid::BareJid;
let jid = BareJid::domain("domain");
assert_eq!(jid.node, None);
let new_jid = jid.with_node("node");
assert_eq!(new_jid.node, Some("node".to_owned()));
Constructs a new Jabber ID from an existing one, with the domain swapped out with a new one.
Examples
use jid::BareJid;
let jid = BareJid::domain("domain");
assert_eq!(jid.domain, "domain");
let new_jid = jid.with_domain("new_domain");
assert_eq!(new_jid.domain, "new_domain");
Constructs a full Jabber ID from a bare Jabber ID, specifying a resource
.
Examples
use jid::BareJid;
let bare = BareJid::new("node", "domain");
let full = bare.with_resource("resource");
assert_eq!(full.node, Some("node".to_owned()));
assert_eq!(full.domain, "domain".to_owned());
assert_eq!(full.resource, "resource".to_owned());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BareJid
impl UnwindSafe for BareJid
Blanket Implementations
Mutably borrows from an owned value. Read more