mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
Implement From<BareJid> and From<FullJid> for Jid.
This commit is contained in:
parent
78b0d016f1
commit
8f0d5c7ca1
1 changed files with 12 additions and 0 deletions
12
src/lib.rs
12
src/lib.rs
|
@ -80,6 +80,18 @@ impl From<Jid> for String {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<BareJid> for Jid {
|
||||
fn from(bare_jid: BareJid) -> Jid {
|
||||
Jid::Bare(bare_jid)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FullJid> for Jid {
|
||||
fn from(full_jid: FullJid) -> Jid {
|
||||
Jid::Full(full_jid)
|
||||
}
|
||||
}
|
||||
|
||||
/// A struct representing a full Jabber ID.
|
||||
///
|
||||
/// A full Jabber ID is composed of 3 components, of which one is optional:
|
||||
|
|
Loading…
Reference in a new issue