#json-rpc #api-bindings #webuntis

untis

Rust库,用于访问webuntis jsonrpc

3个不稳定版本

使用旧的Rust 2015

0.2.1 2018年4月22日
0.2.0 2018年4月21日
0.1.0 2018年3月17日

#155 in #json-rpc

MIT 许可证

21KB
568

untis-rs

Rust库,用于访问webuntis jsonrpc

fn main() {
    let mut untis = Units::new("server", "school", "user", "password");
    let today = Local::today().naive_local();
    
    let info = untis.login().expect("Failed to login");

    let _statusdata  = untis.status_data()                      .expect("Failed to get status data" );
    let _holidays    = untis.holidays()                         .expect("Failed to get holidays"    );
    let _rooms       = untis.rooms()                            .expect("Failed to get rooms"       );
    let _classes     = untis.classes()                          .expect("Failed to get classes"     );
    let _subjects    = untis.subjects()                         .expect("Failed to get subjects"    );
    let _timetable   = untis.timetable(info.class_id, 1, today) .expect("Failed to get timetable"   );
    let _departments = untis.departments()                      .expect("Failed to get departments" );
    // teachers

    untis.logout().expect("Failed to logout");
}

依赖项

~15–25MB
~444K SLoC