Struct lockchain_core::users::UserStore [−][src]
pub struct UserStore { /* fields omitted */ }A utility structure that manages users and can be derived from/into a metadata object. By default this process uses base64 encoding.
The workflow for this is to create a new UserStore, add
users and then use meta_push_domain and give it the
UserStore::into() which is then encoded automatically.
The reverse action works the same way
Methods
impl UserStore[src]
impl UserStorepub fn get_token(&mut self, access: Vec<Access>) -> String[src]
pub fn get_token(&mut self, access: Vec<Access>) -> StringGenerate a sign-up token for a new user which needs to be provided in order for them to create an account.
pub fn get_user(&self, name: &str) -> Option<&User>[src]
pub fn get_user(&self, name: &str) -> Option<&User>pub fn get_all(&self) -> &HashMap<String, User>[src]
pub fn get_all(&self) -> &HashMap<String, User>pub fn add(&mut self, user: User) -> Option<()>[src]
pub fn add(&mut self, user: User) -> Option<()>Trait Implementations
impl Default for UserStore[src]
impl Default for UserStoreimpl AutoEncoder for UserStore[src]
impl AutoEncoder for UserStorefn encode(&self) -> Result<String, SerdeError>[src]
fn encode(&self) -> Result<String, SerdeError>fn decode(s: &str) -> Result<Self, SerdeError>[src]
fn decode(s: &str) -> Result<Self, SerdeError>impl From<(MetaDomain, MetaDomain)> for UserStore[src]
impl From<(MetaDomain, MetaDomain)> for UserStoreAllow users to turn MetaDomains that are userstores into a UserStore easily
Will most likely panic! if called on a non UserStore
fn from((users, registry): (MetaDomain, MetaDomain)) -> Self[src]
fn from((users, registry): (MetaDomain, MetaDomain)) -> SelfPerforms the conversion.
impl From<UserStore> for (MetaDomain, MetaDomain)[src]
impl From<UserStore> for (MetaDomain, MetaDomain)