[−][src]Function mail_test_account::load_account_info
pub fn load_account_info(
tag: &str
) -> Result<Option<AccountAndServiceInfo>, Error>
Loads a AccountAndServiceInfo
instance from a json file from the config dir.
The config dir is the dir defined through the xdg directory spec (i.e. it can
be influenced by environment variables). The default is:
~/.config/ethereal-mail-test-account/<tag>.json
(replacing <tag>
with the
tag).
If no config file is found Ok(None)
is returned.
Error
This can fail for a number of reasons:
- The tag does not match
[a-Z0-9_-]+
. - Getting config file path fails for one reason or another.
- Reading the config file path fails (but the path does exist,
else it would have returned
Ok(None)
).