diff options
author | 2024-12-03 03:51:26 +0000 | |
---|---|---|
committer | 2024-12-03 03:51:26 +0000 | |
commit | 7c2577d196c059ab6e2d5b0efe5e036bdad75be7 (patch) | |
tree | 7649b705f0af85a8b521d8fa849f9ed77e2c201c /src/lib.rs | |
parent | be198ca15bbaf633c1535db5bae7091520546aed (diff) | |
download | luz-7c2577d196c059ab6e2d5b0efe5e036bdad75be7.tar.gz luz-7c2577d196c059ab6e2d5b0efe5e036bdad75be7.tar.bz2 luz-7c2577d196c059ab6e2d5b0efe5e036bdad75be7.zip |
implement remaining rfc6120 xml schemas
Diffstat (limited to '')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -9,14 +9,20 @@ pub mod jid; pub mod stanza; pub use connection::Connection; +use connection::Tls; pub use error::Error; pub use jabber::Jabber; pub use jid::JID; pub type Result<T> = std::result::Result<T, Error>; -pub async fn login<J: TryInto<JID>, P: AsRef<str>>(jid: J, password: P) -> Result<Connection> { - todo!() +pub async fn login<J: AsRef<str>, P: AsRef<str>>(jid: J, password: P) -> Result<Jabber<Tls>> { + Ok(Connection::connect_user(jid, password.as_ref().to_string()) + .await? + .ensure_tls() + .await? + .negotiate() + .await?) } #[cfg(test)] |