[][src]Struct studentvue::client::Client

pub struct Client<'c> {
    pub uri: Cow<'c, str>,
    pub user: &'c str,
    pub pwd: &'c str,
}

Struct which connects to the StudentVUE service

Fields

uri: Cow<'c, str>user: &'c strpwd: &'c str

Methods

impl<'c> Client<'c>[src]

pub fn create(
    district_url: &'c str,
    username: &'c str,
    password: &'c str
) -> Self
[src]

Instantiates a new Client with the username, password, and corresponding StudentVUE district url

pub async fn call_service<'_>(
    &'_ self,
    web_service_handle: WebServiceHandle,
    method_name: Method,
    param_str: ParamBuilder
) -> Result<String, VueError>
[src]

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);
}

pub async fn get_grades<'_>(
    &'_ self,
    report_period: Option<u64>
) -> Result<GbData, VueError>
[src]

Retrieves grades from a student; can be current or from a specified reporting period

pub async fn get_attendance<'_>(&'_ self) -> Result<AttData, VueError>[src]

Gets the absences from the student

pub async fn get_student_info<'_>(&'_ self) -> Result<Student, VueError>[src]

Retrieves student information such as their name, address, and grade

pub async fn get_schedule<'_>(
    &'_ self
) -> Result<StudentClassSchedule, VueError>
[src]

Retrieves the student's current school schedule

pub async fn get_school_info<'_>(
    &'_ self
) -> Result<StudentSchoolInfoListing, VueError>
[src]

Grabs information about the currently attended school

Trait Implementations

impl<'c> Clone for Client<'c>[src]

impl<'c> Debug for Client<'c>[src]

impl<'c> PartialEq<Client<'c>> for Client<'c>[src]

impl<'c> StructuralPartialEq for Client<'c>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.