Skip to content

Latest commit

 

History

History
56 lines (48 loc) · 888 Bytes

Structures.md

File metadata and controls

56 lines (48 loc) · 888 Bytes

Structures

AccountLevel

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AccountLevel {
    Default = 0,
    Admin = 1,
}

AccountError

#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub enum AccountError {
    Nothing,
    PassNotMatched,
    UserNotExists,
    DatabaseError,
    UsernameAlreadyExists,
    EmailAlreadyExists,
    NetworkError,
    PasswordVerifyFailed,
}

BlogError

#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub enum BlogError {
    Nothing,
    AuthError,
    DatabaseError,
    NetworkError,
    PermissionError,
    TooShortTitle,
    TooShortBody,
    InvalidTags,
}

AccountToken

#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct AccountToken {
    pk: i32,
}