Struct jid_gst_meet::FullJid[][src]

pub struct FullJid {
    pub node: Option<String>,
    pub domain: String,
    pub resource: String,
}
Expand description

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

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());

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()));

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");

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.