[][src]Enum rust_keylock::Menu

pub enum Menu {
    TryPass(bool),
    ChangePass,
    Main,
    EntriesList(String),
    NewEntry,
    ShowEntry(usize),
    EditEntry(usize),
    DeleteEntry(usize),
    Save(bool),
    Exit,
    ForceExit,
    TryFileRecovery,
    ImportEntries,
    ExportEntries,
    ShowConfiguration,
    Current,
}

Enumeration of the several different Menus that an Editor implementation should handle.

Variants

TryPass(bool)

The User should provide a password and a number. If bool is true, the last_sync_version will be updated to be the same with the local_version. If false, nothing will be updated.

ChangePass

The User should provide a new password and a new number.

Main

The User should be presented with the main menu.

EntriesList(String)

The User should be presented with a list of all the saved password Entries, filtered by the string provided as argument

NewEntry

The User should create a new Entry

ShowEntry(usize)

The User should be presented with a selected Entry.

The index of the Entry inside the Entries list is provided.

EditEntry(usize)

The User should edit a selected Entry.

The index of the Entry inside the Entries list is provided.

DeleteEntry(usize)

The User deletes a selected Entry.

The index of the Entry inside the Entries list is provided.

Save(bool)

The User encrypts and saves all the existing Entries list. If bool is true, the last_sync_version will be updated to be the same with the local_version. If false, only the local_version will be updated.

Exit

The User selects to Exit rust-keylock

ForceExit

The User selects to Exit rust-keylock, even if there is unsaved data.

TryFileRecovery

Parsing the Entries after decrypting them may lead to wrong data. This Menu informs the User about the situation and offers an attempt to recover anything that is recoverable.

ImportEntries

The user should be able to import password Entries.

ExportEntries

The user should be able to export password Entries.

ShowConfiguration

The user should be presented with the configuration menu

Current

Stay in the current menu

Methods

impl Menu[src]

pub fn get_name(&self) -> String[src]

Returns the name of a Menu.

pub fn from(
    name: String,
    opt_num: Option<usize>,
    opt_string: Option<String>
) -> Menu
[src]

Parses a String and creates a Menu.

Menus that have additional usize and String arguments exist. Thus the existence of the Optional arguments during parsing.

Trait Implementations

impl PartialEq<Menu> for Menu[src]

impl Clone for Menu[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Menu[src]

Auto Trait Implementations

impl Send for Menu

impl Sync for Menu

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self