pub struct SessionConfig { /* private fields */ }Expand description
One session of the client, ready to log in. Built from the host environment
(SessionConfig::from_env) or SessionConfig::new_identity. The nick is the one the
operator assigned with the invite; it is known after the first login.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn new_identity(
product_url: impl Into<String>,
tier: BackendKind,
session_id: impl Into<String>,
store_root: impl Into<PathBuf>,
invite: Option<String>,
) -> Result<Self, ShellError>
pub fn new_identity( product_url: impl Into<String>, tier: BackendKind, session_id: impl Into<String>, store_root: impl Into<PathBuf>, invite: Option<String>, ) -> Result<Self, ShellError>
The session’s identity is generated and kept by the client’s vault under store_root, it
enrolls with the operator’s invite once, and logs in by signature afterwards. tier
picks the product API (tier 2) or the Matrix API (tier 3).
Sourcepub fn for_session(
url: &str,
session_id: &str,
store_root: &Path,
) -> Result<Self, ShellError>
pub fn for_session( url: &str, session_id: &str, store_root: &Path, ) -> Result<Self, ShellError>
A session on url: the tier from TIER_ENV and the operator’s invite from the invite
file (<store_root>/invites/<hash of the session id>), if the operator left one.
Sourcepub fn from_env() -> Result<Self, ShellError>
pub fn from_env() -> Result<Self, ShellError>
Host environment. Required: PRODUCT_URL_ENV (or HOMESERVER_URL_ENV / homeserver_url
in toml), SESSION_ID_ENV, STORE_ROOT_ENV. Optional: PRODUCT_INVITE_ENV (first
login only), TIER_ENV. ROUTINE_URL_ENV and LEADER_SOCK_ENV are not read here.
Sourcepub fn homeserver_url(&self) -> &str
pub fn homeserver_url(&self) -> &str
Homeserver (or product) origin this session logs in at.
Sourcepub fn store_dir(&self) -> PathBuf
pub fn store_dir(&self) -> PathBuf
session_store_dir for this session under the configured root.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Session id the host assigned. Not a secret.