bitwarden_api_api/models/
cipher_type.rs1use serde::{Deserialize, Serialize};
12use serde_repr::{Deserialize_repr, Serialize_repr};
13
14use crate::models;
15#[repr(i64)]
17#[derive(
18 Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize_repr, Deserialize_repr,
19)]
20pub enum CipherType {
21 Login = 1,
22 SecureNote = 2,
23 Card = 3,
24 Identity = 4,
25 SSHKey = 5,
26}
27
28impl std::fmt::Display for CipherType {
29 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30 write!(
31 f,
32 "{}",
33 match self {
34 Self::Login => "1",
35 Self::SecureNote => "2",
36 Self::Card => "3",
37 Self::Identity => "4",
38 Self::SSHKey => "5",
39 }
40 )
41 }
42}
43impl Default for CipherType {
44 fn default() -> CipherType {
45 Self::Login
46 }
47}