Available on crate feature
client only.Expand description
Standard, blocking JMAP client.
Wraps a single boxed stream plus the bearer token and discovered
JmapSession, with one method per common coroutine. JmapClientStd::new
takes a pre-connected stream; with one of the TLS features enabled,
JmapClientStd::connect handles https:// URLs end-to-end.
Run JmapClientStd::session_get once after construction to populate the
session; subsequent calls resolve accountId and apiUrl from it.
§Example
use io_jmap::client::JmapClientStd;
use pimalaya_stream::tls::Tls;
use secrecy::SecretString;
use url::Url;
let url: Url = "https://api.example.com/jmap/session/".parse().unwrap();
let auth = SecretString::from("Bearer xyz");
let mut client = JmapClientStd::connect(&url, &Tls::default(), auth).unwrap();
let session = client.session_get(&url).unwrap();
println!("logged in as {}", session.username);Structs§
- Jmap
Client Std - Std-blocking JMAP client wrapping a single boxed stream.
Enums§
- Jmap
Client StdError - Errors returned by
JmapClientStd.
Traits§
- Jmap
Stream - Erased stream the client resumes coroutines against: auto-implemented for
any blocking
Read + Write + Send + 'static.Sendflows through theBox<dyn …>soJmapClientStdcan move between worker threads;Self::as_any_mutlets specialized callers downcast back to the concrete stream.