pub struct Client<'c> {
pub uri: Cow<'c, str>,
pub user: &'c str,
pub pwd: &'c str,
}
Expand description
Struct which connects to the StudentVUE service
Fields§
§uri: Cow<'c, str>
§user: &'c str
§pwd: &'c str
Implementations§
Source§impl<'c> Client<'c>
impl<'c> Client<'c>
Sourcepub fn create(
district_url: &'c str,
username: &'c str,
password: &'c str,
) -> Self
pub fn create( district_url: &'c str, username: &'c str, password: &'c str, ) -> Self
Instantiates a new Client
with the username, password, and corresponding StudentVUE district url
Sourcepub async fn call_service(
&self,
web_service_handle: WebServiceHandle,
method_name: Method,
param_str: ParamBuilder,
) -> Result<String, VueError>
pub async fn call_service( &self, web_service_handle: WebServiceHandle, method_name: Method, param_str: ParamBuilder, ) -> Result<String, VueError>
Calls a method from a specified WebServiceHandle
with the specified parameters
§Example
use studentvue::{
client::Client,
enums::{Method, WebServiceHandle},
client::ParamBuilder
};
use std::env;
#[tokio::main]
async fn main() {
let (user, pwd) = (env::args().next().unwrap(), env::args().next().unwrap());
let client = Client::create("https://studentvue.phoenixunion.org", user.as_str(), pwd.as_str());
let xml = client.call_service(WebServiceHandle::PXPWebServices, Method::StudentSchoolInfo, ParamBuilder::create())
.await
.expect("Could not call service!");
println!("{}", xml);
}
Sourcepub async fn get_grades(
&self,
report_period: Option<u64>,
) -> Result<GbData, VueError>
pub async fn get_grades( &self, report_period: Option<u64>, ) -> Result<GbData, VueError>
Retrieves grades from a student; can be current or from a specified reporting period
Sourcepub async fn get_attendance(&self) -> Result<AttData, VueError>
pub async fn get_attendance(&self) -> Result<AttData, VueError>
Gets the absences from the student
Sourcepub async fn get_student_info(&self) -> Result<Student, VueError>
pub async fn get_student_info(&self) -> Result<Student, VueError>
Retrieves student information such as their name, address, and grade
Sourcepub async fn get_schedule(&self) -> Result<StudentClassSchedule, VueError>
pub async fn get_schedule(&self) -> Result<StudentClassSchedule, VueError>
Retrieves the student’s current school schedule
Sourcepub async fn get_school_info(
&self,
) -> Result<StudentSchoolInfoListing, VueError>
pub async fn get_school_info( &self, ) -> Result<StudentSchoolInfoListing, VueError>
Grabs information about the currently attended school
Trait Implementations§
impl<'c> StructuralPartialEq for Client<'c>
Auto Trait Implementations§
impl<'c> Freeze for Client<'c>
impl<'c> RefUnwindSafe for Client<'c>
impl<'c> Send for Client<'c>
impl<'c> Sync for Client<'c>
impl<'c> Unpin for Client<'c>
impl<'c> UnwindSafe for Client<'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more