Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Error {
- InvalidLoginOrPassword,
- Other,
- }
- trait StatusOk {
- type Response;
- fn ok() -> Self::Response {
- Self::Response {
- code: 200
- }
- }
- }
- struct LoginForm {
- code: i32
- }
- impl StatusOk for LoginForm {
- type Response = Self;
- }
- fn login<'a>(_username: &'a str, _password: &'a str) -> Result<LoginForm, Error> {
- Ok(LoginForm::ok())
- }
- fn main() {
- login("Username", "Password");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement