MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / new

Method new

library/src/domain/auth/entity.rs:33–43  ·  view source on GitHub ↗
(id: String, email: String, password: String, nickname: String)

Source from the content-addressed store, hash-verified

31
32impl Account {
33 pub fn new(id: String, email: String, password: String, nickname: String) -> Self {
34 Self {
35 id,
36 email,
37 state: Default::default(),
38 hashed_password: Self::hash_password(password),
39 nickname,
40 create_dt: Default::default(),
41 version: 0,
42 }
43 }
44 pub fn hash_password(plain_password: String) -> String {
45 bcrypt::hash(plain_password, 4).unwrap()
46 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected