Skip to content

Basic Todo CLI is a terminal ToDo List with users

Notifications You must be signed in to change notification settings

GonzaBena/TodoCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo CLI

Description: Todo CLI is a terminal ToDo List with users, lists and other features

- Dependencies

[dependencies]
colored = "0.2.0"

Use to add

[main.rs]

use std::collections::HashMap;
use std::io::{self, Write};

[lib.rs]

use std::collections::HashMap;
use std::io::{self, Write};

- Structs

User

[Signature]

#[derive(Debug, PartialEq)] // With this, you can realize the tests
pub struct User {
    pub name: String,
    pub pass: String,
}

[User's Methods]

pub fn new(name: String, pass: String) -> User;
pub fn change_pass(&mut self, pass: String);

Task

[Signature]

#[derive(Debug, PartialEq)] // With this, you can realize the tests
pub struct Task {
    pub id: u32,
    pub description: String,
    pub user: User,
    pub status: bool,
}

[Task's Methods]

pub fn new(id: &mut u32, description: String, user: User, status: bool) -> Task;
pub fn belongs_to(&self, user: &User) -> bool;

UserList

[Signature]

#[derive(Debug, PartialEq)] // With this, you can realize the tests
pub struct UserList {
    pub users: HashMap<String, String>
}

[UserList's Methods]

pub fn new() -> UserList;
pub fn login(&self) -> bool;
pub fn register(&mut self) -> bool;

TodoList

[Signature]

#[derive(Debug, PartialEq)] // With this, you can realize the tests
pub struct TodoList {
    pub tasks: Vec<Task>,
}

[TodoList's Methods]

pub fn new() -> TodoList;
pub fn from(tasks: Vec<Task>) -> TodoList;
pub fn insert(&mut self, task: Task);
pub fn show_all(&self);
pub fn find_all(&self, user: &User) -> Vec<&Task>;
pub fn find_one(&self, user: &User) -> &Task;

About

Basic Todo CLI is a terminal ToDo List with users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages