msnp11-sdk 0.12.0

An MSNP11 client SDK
Documentation
//! An MSNP11 client SDK.
//! # Login
//! ```
//! use msnp11_sdk::client::Client;
//! use msnp11_sdk::enums::event::Event;
//! use msnp11_sdk::models::personal_message::PersonalMessage;
//! use msnp11_sdk::enums::msnp_status::MsnpStatus;
//!
//! let mut client = Client::new("127.0.0.1", 1863)
//!    .await
//!    .unwrap();
//!
//! client.add_event_handler_closure(|event| async { /* Handle events... */ });
//!
//! // Handle a redirection by creating a new connection
//! if let Ok(Event::RedirectedTo { server, port }) = client
//!     .login(
//!         "testing@example.com".to_string(),
//!         "123456",
//!         "http://localhost:3000/rdr/pprdr.asp",
//!         "msnp11-sdk",
//!         "0.11.1"
//!     )
//!     .await
//!  {
//!     client = Client::new(&*server, port).await.unwrap();
//!     client
//!         .login(
//!             "testing@example.com".to_string(),
//!             "123456",
//!             "http://localhost:3000/rdr/pprdr.asp",
//!             "msnp11-sdk",
//!             "0.11.1"
//!         )
//!         .await
//!         .unwrap();
//!  }
//!
//! client.set_presence(MsnpStatus::Online).await.unwrap();
//! client
//!     .set_personal_message(&PersonalMessage {
//!         psm: "test".to_string(),
//!         current_media: "".to_string(),
//!     })
//!     .await
//!     .unwrap();
//! ```
//! # Bindings
//! Bindings for Kotlin and Swift can be generated with
//! [UniFFI](https://mozilla.github.io/uniffi-rs/latest/tutorial/foreign_language_bindings.html#multi-crate-workspaces).
//!

pub mod client;
pub mod enums;
mod errors;
#[cfg(feature = "uniffi")]
pub mod event_handler;
#[cfg(feature = "uniffi")]
mod exports;
mod http;
pub mod models;
mod notification_server;
mod receive_split;
pub mod switchboard_server;

#[cfg(feature = "uniffi")]
uniffi::setup_scaffolding!();

pub use client::Client;
pub use enums::event::Event;
pub use enums::msnp_list::MsnpList;
pub use enums::msnp_status::MsnpStatus;
pub use errors::contact_error::ContactError;
pub use errors::messaging_error::MessagingError;
pub use errors::p2p_error::P2pError;
pub use errors::sdk_error::SdkError;
pub use models::msn_object::MsnObject;
pub use models::personal_message::PersonalMessage;
pub use models::plain_text::PlainText;
pub use models::presence::Presence;
pub use switchboard_server::switchboard::Switchboard;

#[cfg(feature = "config")]
pub use http::config::Config;
#[cfg(feature = "config")]
pub use http::xml::tab::Tab;