diff options
Diffstat (limited to 'src/browser/mod.rs')
-rw-r--r-- | src/browser/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/browser/mod.rs b/src/browser/mod.rs index 8359c51..2765c6d 100644 --- a/src/browser/mod.rs +++ b/src/browser/mod.rs @@ -1,3 +1,5 @@ +use std::collections::HashMap; + use self::web_browser::{Browser, WEB_BROWSER}; use crate::Config; use thirtyfour::prelude::WebDriverResult; @@ -17,3 +19,18 @@ pub async unsafe fn login(credentials: &Config) -> WebDriverResult<()> { Ok(()) } + +pub async unsafe fn get_faculties() -> WebDriverResult<Option<HashMap<String, String>>> { + if let Some(driver) = &WEB_BROWSER { + match driver.faculties().await? { + Some(faculties) => { + return Ok(Some(faculties)); + } + None => { + return Ok(Some(HashMap::<String, String>::new())); + } + }; + } + + Ok(Some(HashMap::<String, String>::new())) +} |