pub struct Users {
pub username: String,
}
Fields§
§username: String
Implementations§
Source§impl Users
impl Users
Sourcepub fn get(&self) -> GetUserBuilder
pub fn get(&self) -> GetUserBuilder
Gets a user by their username. This will return a [User] object if the user exists and is visible to the currently authenticated user. If the user does not exist or is not visible, this method will return a 404 status code and an empty response.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let user = client
.users("username")
.get()
.send(&client)
.await
.unwrap();
This will get the user with the username “username”. If the user does not exist, this method will return a [TeatimeError] with a 404 status code.
Sourcepub fn list_repos(&self) -> ListReposBuilder
pub fn list_repos(&self) -> ListReposBuilder
Gets the repositories for a user. This will return a list of repositories for the user.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let repos = client
.users("username")
.list_repos()
.send(&client)
.await
.unwrap();
Sourcepub fn list_starred(&self) -> ListStarredBuilder
pub fn list_starred(&self) -> ListStarredBuilder
Gets the stars for a user. This will return a list of starred repositories for the user.
§Example
let client = Client::new(
"https://gitea.example.com",
Auth::Token("your-token")
);
let stars = client
.users("username")
.list_starred()
.send(&client)
.await
.unwrap();
Auto Trait Implementations§
impl Freeze for Users
impl RefUnwindSafe for Users
impl Send for Users
impl Sync for Users
impl Unpin for Users
impl UnwindSafe for Users
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