Heyo! I'm trying to access the course list of hub.courses().list().doit().await; where I assume that each course is a separate Course struct, through the following piece of code:
match req {
Err(e) => print!("{}",e),
Ok(output) => courseListParse(output.1, clist),
}
// outside of function...
fn courseListParse(mut response:ListCoursesResponse, mut clist:Vec<class::classType>){
for i in &response.courses{
println!("{:?}\n", i); // this print statement is a placeholder so i can view the data returned by the gclassroom api, and later aggregate it
}
}
however, i am running into an issue where the data returned by response.courses is a single element, probably a vector of classes. I cannot access any elements of this vector through this current function.
I'm quite new to rust, so if I'm making any obvious mistake, please let me know. I did look over rustdoc and found out that the courses variable in ListCoursesResponse is a vector of Courses, which I think would typically be accessible through response.courses.[0-x] as per a typical vector.
Heyo! I'm trying to access the course list of
hub.courses().list().doit().await;
where I assume that each course is a separateCourse
struct, through the following piece of code:however, i am running into an issue where the data returned by
response.courses
is a single element, probably a vector of classes. I cannot access any elements of this vector through this current function.I'm quite new to rust, so if I'm making any obvious mistake, please let me know. I did look over rustdoc and found out that the
courses
variable inListCoursesResponse
is a vector ofCourse
s, which I think would typically be accessible throughresponse.courses.[0-x]
as per a typical vector.